From 168fd6c9b2ef95c93d8e0b48117b7bc8f93043ed Mon Sep 17 00:00:00 2001 From: LianLiguang Date: Thu, 17 Dec 2020 14:45:11 +0800 Subject: [PATCH] fix bug of pynative mixedprecision --- mindspore/nn/cell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/nn/cell.py b/mindspore/nn/cell.py index f2d91244e3..399615145b 100755 --- a/mindspore/nn/cell.py +++ b/mindspore/nn/cell.py @@ -644,7 +644,7 @@ class Cell(Cell_): param.set_cast_dtype(mstype.float32) elif self._mindspore_flags.get('fp16'): param.set_cast_dtype(mstype.float16) - else: + elif hasattr(param, "set_cast_dtype"): # retest dtype param.set_cast_dtype() return param