mindspore.ops.truncate_div

View Source On Gitee
mindspore.ops.truncate_div(x, y)[source]

Divide the first input tensor x by the second input tensor y element-wise and rounds the results of division towards zero.

Note

Support implicit type conversion and broadcasting.

Parameters
  • x (Union[Tensor, Number, bool]) – The first input tensor.

  • y (Union[Tensor, Number, bool]) – The second input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> mindspore.ops.truncate_div(mindspore.tensor([2, 4, -1]), mindspore.tensor([3, 3, 3]))
Tensor(shape=[3], dtype=Int64, value= [0, 1, 0])