mindspore.Tensor.floor_divide

查看源文件
mindspore.Tensor.floor_divide(other)

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

警告

这是一个实验性API,后续可能修改或删除。

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> from mindspore import Tensor
>>> import numpy as np
>>> input = Tensor(np.array([2, 4, -1]), mindspore.int32)
>>> other = Tensor(np.array([3, 3, 3]), mindspore.int32)
>>> output = input.floor_divide(other)
>>> print(output)
[ 0  1 -1]
>>> input = Tensor(2.0, mindspore.float32)
>>> other = Tensor(2.0, mindspore.float32)
>>> output = input.floor_divide(other)
>>> print(output)
1.0