mindspore.ops.truncate_mod

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

Return the remainder of division element-wise.

Support implicit type conversion and broadcasting.

Warning

  • The input data does not support 0.

  • When the elements of input exceed 2048 , the accuracy of operator cannot guarantee the requirement of double thousandths in the mini form.

  • Due to different architectures, the calculation results of this operator on NPU and CPU may be inconsistent.

  • If shape is expressed as (D1,D2… ,Dn), then D1*D2… *DN<=1000000,n<=8.

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
>>> output = mindspore.ops.truncate_mod(mindspore.tensor([2., 4., -1.]), mindspore.tensor([3., 3., 3.]))
>>> print(output)
[ 2.  1. -1.]