mindspore.Tensor.div
- mindspore.Tensor.div(value, *, rounding_mode=None)
详情请参考
mindspore.ops.div()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> x = Tensor(np.array([1.0, 2.0, 3.0]), mindspore.float32) >>> y = Tensor(np.array([4.0, 5.0, 6.0]), mindspore.float32) >>> output = x.div(y) >>> print(output) [0.25 0.4 0.5]