def test_set_policy_multiple_times(self):
        """Test setting the policy multiple times in a row."""
        set_dtype_policy("mixed_float16")
        policy = dtype_policy()
        self.assertEqual(policy.name, "mixed_float16")

        set_dtype_policy("float32")
        policy = dtype_policy()
        self.assertEqual(policy.name, "float32")
Test setting the policy multiple times in a row.
keras/src/dtype_policies/dtype_policy_test.py