From a6a6d735ad4bdcf3b7db02ce3afb62da760c9581 Mon Sep 17 00:00:00 2001 From: Guo Sheng Date: Thu, 21 May 2020 15:52:38 +0800 Subject: [PATCH] Fix _forget_bias.stop_gradient workround in hapi.text.BasicLSTMCell. (#24655) test=develop --- python/paddle/incubate/hapi/text/text.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/incubate/hapi/text/text.py b/python/paddle/incubate/hapi/text/text.py index c5cd4ae563..1424ce0381 100644 --- a/python/paddle/incubate/hapi/text/text.py +++ b/python/paddle/incubate/hapi/text/text.py @@ -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 -- GitLab