def test_initialization_non_string_name(self):
        """Test initialization with a non-string name."""
        with self.assertRaisesRegex(TypeError, "'name' must be a string"):
            DTypePolicy(123)

        with self.assertRaisesRegex(TypeError, "'name' must be a string"):
            FloatDTypePolicy(123)
Test initialization with a non-string name.
keras/src/dtype_policies/dtype_policy_test.py