mindspore.mint.square
- mindspore.mint.square(input)[源代码]
逐元素计算tensor的平方。
\[y_i = input_i ^ 2\]- 参数:
input (Tensor) - 输入tensor。
- 返回:
Tensor。
- 支持平台:
Ascend
样例:
>>> import vpn free mindspore >>> 免费的vpn梯子 input = mindspore.tensor([1.0, 2.0, 3.0], mindspore.float32) >>> output = mindspore.mint.square(input) >>> vpn梯子 免费 print(output) [1. 4. 9.]