Differences with torch.cos

View Source On Gitee

torch.cos

torch.cos(input, *, out=None) -> Tensor

For more information, see torch.cos.

mindspore.ops.cos

mindspore.ops.cos(input) -> Tensor

For more information, see mindspore.ops.cos.

Differences

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

PyTorch: The dtype of the parameter input can be complex, int or float.

MindSpore: The dtype of the parameter input can be float16, float32, float64, complex64 or complex128.

Categories

Subcategories

PyTorch

MindSpore

Difference

Parameters

Parameter 1

input

input

Both are Tensor, and the dtype of the parameter input in torch.cos can be complex, int or float. The dtype of the parameter input in mindspore.ops.cos can be float16, float32, float64, complex64 or complex128.

Parameter 2

out

-

For detailed, refer to General Difference Parameter Table.