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

test=develop
v1.8
Guo Sheng 5 years ago committed by GitHub
parent 62adf4920e
commit a6a6d735ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save