mindspore.numpy.negative
- mindspore.numpy.negative(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.negative(a) >>> print(output) [-1. 1.]