设计
模型库
API
API映射
迁移指南
语法支持
FAQ
RELEASE NOTES
对输入逐元素按位翻转。
x (Tensor) - x 的shape为 (x1,x2,...,xR)。其数据类型为int16或uint16。
Tensor,shape和类型与输入相同。
TypeError - x 的数据类型不为int16或uint16。
Ascend GPU CPU
Ascend
GPU
CPU
样例:
>>> x = Tensor(np.array([25, 4, 13, 9]), mindspore.int16) >>> output = ops.invert(x) >>> print(output) [-26 -5 -14 -10]