未验证 提交 a9050465 编写于 作者: G Guo Sheng 提交者: GitHub

Fix _forget_bias.stop_gradient workround in hapi.text.BasicLSTMCell. (#24655) (#24687)

test=release/2.0-alpha
上级 04327c46
......@@ -254,7 +254,8 @@ class BasicLSTMCell(RNNCell):
# TODO(guosheng): find better way to resolve constants in __init__
self._forget_bias = layers.create_global_var(
shape=[1], dtype=dtype, value=forget_bias, persistable=True)
self._forget_bias.stop_gradient = True
# TODO(guosheng): refine this if recurrent_op removes gradient require
self._forget_bias.stop_gradient = False
self._dtype = dtype
self._input_size = input_size
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册