forked from mindspore-Ecosystem/mindspore
!8085 Loss saved does not reduce precision in SummaryCollector
Merge pull request !8085 from ougongchang/fix_round
This commit is contained in:
commit
74886f790d
|
@ -548,8 +548,7 @@ class SummaryCollector(Callback):
|
||||||
if not isinstance(loss, Tensor):
|
if not isinstance(loss, Tensor):
|
||||||
loss = Tensor(loss)
|
loss = Tensor(loss)
|
||||||
|
|
||||||
precision = 4
|
loss = Tensor(np.mean(loss.asnumpy()))
|
||||||
loss = Tensor(round(np.mean(loss.asnumpy()), precision))
|
|
||||||
return loss
|
return loss
|
||||||
|
|
||||||
def _get_optimizer(self, cb_params):
|
def _get_optimizer(self, cb_params):
|
||||||
|
|
Loading…
Reference in New Issue