From f9f21a5c57f7594f34ae2a84ce64dd89686fa2fe Mon Sep 17 00:00:00 2001 From: lyuwenyu Date: Thu, 17 Jun 2021 17:52:07 +0800 Subject: [PATCH] update in static mode --- python/paddle/hapi/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index f4d3a78e25..b8de4ee05a 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -298,10 +298,11 @@ class StaticGraphAdapter(object): def mode(self, 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, \ "model not ready, please call `model.prepare()` first" self.mode = 'train' + assert update is True, "Model does not support `update == False` in static mode by now." return self._run(inputs, labels) def eval_batch(self, inputs, labels=None): -- GitLab