forked from mindspore-Ecosystem/mindspore
!17664 fix I3TGGM: set_train in step loop, performance slows down.
From: @zhangzhaoju Reviewed-by: @ginfung,@zh_qh Signed-off-by: @zh_qh
This commit is contained in:
commit
f89f811dc3
|
@ -1018,12 +1018,14 @@ class Cell(Cell_):
|
|||
|
||||
def add_flags_recursive(self, **flags):
|
||||
self.add_flags(**flags)
|
||||
if hasattr(self, '_cell_init_args'):
|
||||
self._cell_init_args += str({**flags})
|
||||
for cell in self.cells():
|
||||
cell.add_flags_recursive(**flags)
|
||||
return self
|
||||
|
||||
def _add_init_args(self, **args):
|
||||
if hasattr(self, '_cell_init_args'):
|
||||
self._cell_init_args += str({**args})
|
||||
|
||||
def get_flags(self):
|
||||
if not hasattr(self, "_mindspore_flags"):
|
||||
self._mindspore_flags = {}
|
||||
|
|
Loading…
Reference in New Issue