forked from mindspore-Ecosystem/mindspore
!9149 Fix bug of moments precision error in pynative
From: @joylvliang Reviewed-by: @chujinjin,@kisnwang,@jjfeing,@chujinjin Signed-off-by: @chujinjin
This commit is contained in:
commit
d67c54b0dc
|
@ -157,6 +157,8 @@ def tuple_to_array(x):
|
||||||
|
|
||||||
def stop_gradient(x):
|
def stop_gradient(x):
|
||||||
"""Implement `stop_gradient`."""
|
"""Implement `stop_gradient`."""
|
||||||
|
if isinstance(x, Tensor):
|
||||||
|
return Tensor(x.asnumpy())
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue