self.fp32_trainer.update(step_size)
overflow = is_finite.asscalar() < 1
else:
overflow = not np.isfinite(norm.asscalar())
if not overflow:
self.fp32_trainer.update(step_size)
else:
// TODO(haibin) optimize the performance when max_norm is not present
After Change
self.fp32_trainer.update(step_size)
overflow = is_finite.asscalar() < 1
else:
overflow = is_finite.asscalar() < 1
if not overflow:
self.fp32_trainer.update(step_size)
else: