def METHOD_NAME(self):
    opt = gradient_descent_v2.SGD(1.0)
    opt = loss_scale_optimizer_v2.LossScaleOptimizer(opt)
    with self.assertRaisesRegex(
        ValueError,
        '"opt" must not already be an instance of a LossScaleOptimizer.',
    ):
        tf.compat.v1.mixed_precision.enable_mixed_precision_graph_rewrite(
            opt
        )
    self.assertFalse(
        tf.config.optimizer.get_experimental_options().get(
            "auto_mixed_precision", False
        )
    )