Differences with torch.isclose

View Source On Gitee

torch.isclose

torch.isclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False) -> Tensor

For more information, see torch.isclose

mindspore.ops.isclose

mindspore.ops.isclose(x1, x2, rtol=1e-05, atol=1e-08, equal_nan=False) -> Tensor

For more information, see mindspore.ops.isclose

Differences

API function of MindSpore is consistent with that of PyTorch, with differences in the supported data types for parameters.

PyTorch: The dtype of parameter input and other can be bool , int or float .

MindSpore: The dtype of parameter x1 and x2 can be int32 , float32 or float16 .

Categories

Subcategories

PyTorch

MindSpore

Difference

Parameters

Parameter 1

input

x1

Different parameter names. The parameter input and x1 are Tensors,while the dtype of input can be bool , int or float , the dtype of x1 can be int32 , float32 or float16 .

Parameter 2

other

x2

Different parameter names. The parameter other and x2 are Tensors,while the dtype of other can be bool , int or float , the dtype of x2 can be int32 , float32 or float16 .

Parameter 3

rtol

rtol

-

Parameter 4

atol

atol

-

Parameter 5

equal_nan

equal_nan

-