From ae33348a36ad2b6822ba04b29580fba8965fc328 Mon Sep 17 00:00:00 2001 From: Reed Wanderman-Milne Date: Wed, 25 Mar 2020 16:12:42 -0700 Subject: [PATCH] Fix order-dependent mixed precision test. PiperOrigin-RevId: 302992910 Change-Id: Ifc776a95eb6a69ba2c5806dc9afeacdfbff9bcb7 --- .../python/keras/mixed_precision/experimental/policy_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tensorflow/python/keras/mixed_precision/experimental/policy_test.py b/tensorflow/python/keras/mixed_precision/experimental/policy_test.py index ff809d061cb..81d461c304d 100644 --- a/tensorflow/python/keras/mixed_precision/experimental/policy_test.py +++ b/tensorflow/python/keras/mixed_precision/experimental/policy_test.py @@ -166,6 +166,8 @@ class PolicyTest(test.TestCase, parameterized.TestCase): 'not passing any loss_scale instead.') for policy_name in 'float16', 'mixed_float16': + # Trigger any other warnings that occur only once + mp_policy.Policy(policy_name, loss_scale=2.) with test.mock.patch.object(tf_logging, 'warn') as mock_warn: mp_policy.Policy(policy_name, loss_scale=2.) mock_warn.assert_not_called()