!6485 Add amp_level "auto" to _build_eval_network

Merge pull request !6485 from wanyiming/add_auto_to_eval
This commit is contained in:
mindspore-ci-bot 2020-09-18 18:20:49 +08:00 committed by Gitee
commit 12b6086722
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class Model:
else:
if self._loss_fn is None:
raise ValueError("loss_fn can not be None.")
self._eval_network = nn.WithEvalCell(self._network, self._loss_fn, self._amp_level in ["O2", "O3"])
self._eval_network = nn.WithEvalCell(self._network, self._loss_fn, self._amp_level in ["O2", "O3", "auto"])
self._eval_indexes = [0, 1, 2]
if self._parallel_mode in (ParallelMode.SEMI_AUTO_PARALLEL, ParallelMode.AUTO_PARALLEL):