mindspore.numpy.positive
- mindspore.numpy.positive(a, dtype=None)[源代码]
- 数值取正,逐元素计算。 - 说明 - 不支持NumPy参数 out 、 where 、 casting 、 order 、 subok 、 signature 、 extobj 。 - 参数:
- a (Tensor) - 输入Tensor。 
- dtype (mindspore.dtype, 可选) - 默认值: - None。 覆盖输出Tensor的dtype。
 
- 返回:
- Tensor。 
- 支持平台:
- Ascend- GPU- CPU
 - 样例: - >>> import mindspore.numpy as np >>> a = np.asarray([1, -1]).astype('float32') >>> output = np.positive(a) >>> print(output) [1. -1.]