mindspore.Tensor.negative

查看源文件
mindspore.Tensor.negative()

详情请参考 mindspore.ops.negative()

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor
>>> input = Tensor(np.array([1, 2, -1, 2, 0, -3.5]), mindspore.float32)
>>> output = Tensor.negative(input)
>>> print(output)
[-1.  -2.   1.  -2.   0.   3.5]