Closed acgtyrant closed 6 years ago
See https://github.com/vacancy/Synchronized-BatchNorm-PyTorch/blob/master/sync_batchnorm/unittest.py#L28
If npa is negative at all, then np.fmax will return 1e-5, even the abs of npa is greater than 1e-5.
1e-5
By the way, np.fmax(npa, 1e-5)) is use for when npa is 0 at all?
np.fmax(npa, 1e-5))
Thanks for the reporting. I think it should be np.fmax(np.abs(npa), 1e-5).max(). I will fix it later.
np.fmax(np.abs(npa), 1e-5).max()
See https://github.com/vacancy/Synchronized-BatchNorm-PyTorch/blob/master/sync_batchnorm/unittest.py#L28
If npa is negative at all, then np.fmax will return
1e-5
, even the abs of npa is greater than1e-5
.