未验证 提交 832458d5 编写于 作者: S Steffy-zxf 提交者: GitHub

update code examples for paddle.sums

update code examples for paddle.sums 
上级 202bfab1
...@@ -162,8 +162,8 @@ def monkey_patch_varbase(): ...@@ -162,8 +162,8 @@ def monkey_patch_varbase():
# there is no one need gradient on it. # there is no one need gradient on it.
tmp.stop_gradient=False tmp.stop_gradient=False
inputs.append(tmp) inputs.append(tmp)
ret = paddle.sums(inputs) ret = paddle.add_n(inputs)
loss = paddle.fluid.layers.reduce_sum(ret) loss = paddle.sum(ret)
loss.backward() loss.backward()
""" """
......
...@@ -1192,8 +1192,8 @@ class Variable(object): ...@@ -1192,8 +1192,8 @@ class Variable(object):
# there is no one need gradient on it. # there is no one need gradient on it.
tmp.stop_gradient=False tmp.stop_gradient=False
inputs.append(tmp) inputs.append(tmp)
ret = paddle.sums(inputs) ret = paddle.add_n(inputs)
loss = paddle.fluid.layers.reduce_sum(ret) loss = paddle.sum(ret)
loss.backward() loss.backward()
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册