提交 f9f21a5c 编写于 作者: L lyuwenyu 提交者: jzhang533

update in static mode

上级 c96fe02f
...@@ -298,10 +298,11 @@ class StaticGraphAdapter(object): ...@@ -298,10 +298,11 @@ class StaticGraphAdapter(object):
def mode(self, value): def mode(self, value):
self.model.mode = value self.model.mode = value
def train_batch(self, inputs, labels=None): def train_batch(self, inputs, labels=None, update=True):
assert self.model._optimizer, \ assert self.model._optimizer, \
"model not ready, please call `model.prepare()` first" "model not ready, please call `model.prepare()` first"
self.mode = 'train' self.mode = 'train'
assert update is True, "Model does not support `update == False` in static mode by now."
return self._run(inputs, labels) return self._run(inputs, labels)
def eval_batch(self, inputs, labels=None): def eval_batch(self, inputs, labels=None):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册