Fix lint errors
This commit is contained in:
parent
ac3775ae75
commit
e73a77d19d
@ -196,7 +196,7 @@ class FixedLossScale(LossScale):
|
||||
def _is_all_finite(grads):
|
||||
"""Returns a scalar boolean tensor indicating if all gradients are finite."""
|
||||
is_finite_per_grad = [
|
||||
math_ops.reduce_all(math_ops.is_finite(g)) for g in grads if g is not None
|
||||
math_ops.reduce_all(math_ops.is_finite(g)) for g in grads if g is not None
|
||||
]
|
||||
return math_ops.reduce_all(is_finite_per_grad)
|
||||
|
||||
|
@ -253,7 +253,7 @@ class DynamicLossScaleTest(test.TestCase, parameterized.TestCase):
|
||||
self._test_helper(inputs, expected_outputs, init_loss_scale)
|
||||
|
||||
@test_util.run_in_graph_and_eager_modes
|
||||
def test_update_with_None_gradients(self, strategy_fn):
|
||||
def test_update_with_none_gradients(self, strategy_fn):
|
||||
with strategy_fn().scope():
|
||||
loss_scaler = loss_scale_module.DynamicLossScale()
|
||||
loss_scaler.update([None])
|
||||
|
Loading…
x
Reference in New Issue
Block a user