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

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

test=develop
上级 62adf492
...@@ -254,7 +254,8 @@ class BasicLSTMCell(RNNCell): ...@@ -254,7 +254,8 @@ class BasicLSTMCell(RNNCell):
# TODO(guosheng): find better way to resolve constants in __init__ # TODO(guosheng): find better way to resolve constants in __init__
self._forget_bias = layers.create_global_var( self._forget_bias = layers.create_global_var(
shape=[1], dtype=dtype, value=forget_bias, persistable=True) 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._dtype = dtype
self._input_size = input_size self._input_size = input_size
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册