提交 3b8bade6 编写于 作者: Q qiaolongfei

init learning_rate_map when input learning rate is a Variable

上级 28ff1cda
......@@ -45,6 +45,9 @@ class Optimizer(object):
# each program should have a independent learning rate
# program -> Variable(learning_rate)
self._learning_rate_map = defaultdict(lambda: None)
if isinstance(self._learning_rate, framework.Variable):
self._learning_rate_map[framework.default_main_program(
)] = self._learning_rate
# Dictionary of accumulators. Some optimizer subclasses need to
# allocate and manage extra variables associated with the parameters
# to train. These variables are called accumulators.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册