OS platform and distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 22.04
GCC/Compiler version (if compiled from source): 7.5.0
Describe the current behavior
I once reproduced a bug in Pytroch, and when I converted the Pytroch method to the mindspore method, I found that the problem still existed. This problem was identified as a bug in Pytroch.
I get unstable results when sin, arcsin, arccos are called sequentially. sin followed by arcsin should give by the same value, however the calculation is not exactly the same and we get unstable results after arccos: 0.00034527 on CPU and nan on GPU.
Describe the expected behavior
[0,0]
Steps to reproduce the issue
from mindspore import set_context
import mindspore.ops as ops
set_context(device_target="CPU")
x = ops.ones(2)
y = ops.sin(x)
y = ops.arcsin(y)
y = ops.arccos(y)
print(y) # gives [0.00034527 0.00034527]
set_context(device_target="GPU")
y1 = ops.sin(x)
y1 = ops.arcsin(y1)
y1 = ops.arccos(y1)
print(y1) # gives [nan nan] should be [0,0]
Environment
Hardware Environment(
Ascend
/GPU
/CPU
):Software Environment:
Describe the current behavior
I once reproduced a bug in Pytroch, and when I converted the Pytroch method to the mindspore method, I found that the problem still existed. This problem was identified as a bug in Pytroch. I get unstable results when sin, arcsin, arccos are called sequentially. sin followed by arcsin should give by the same value, however the calculation is not exactly the same and we get unstable results after arccos: 0.00034527 on CPU and nan on GPU.
Describe the expected behavior
[0,0]
Steps to reproduce the issue