提交 32059d22 编写于 作者: S sneaxiy

fix paddle.var stop_gradient error

上级 0699afb1
...@@ -182,6 +182,7 @@ def var(x, axis=None, unbiased=True, keepdim=False, name=None): ...@@ -182,6 +182,7 @@ def var(x, axis=None, unbiased=True, keepdim=False, name=None):
if unbiased: if unbiased:
one_const = paddle.ones([1], x.dtype) one_const = paddle.ones([1], x.dtype)
n = where(n > one_const, n - 1.0, one_const) n = where(n > one_const, n - 1.0, one_const)
n.stop_gradient = True
out /= n out /= n
return out return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册