From a9050465c5d2638ad03108823a1c7d0c6aef0f37 Mon Sep 17 00:00:00 2001 From: Guo Sheng Date: Sun, 24 May 2020 13:03:46 +0800 Subject: [PATCH] Fix _forget_bias.stop_gradient workround in hapi.text.BasicLSTMCell. (#24655) (#24687) test=release/2.0-alpha --- 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 c5cd4ae5632..1424ce0381a 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