def METHOD_NAME(self):
    model = CustomModelX()
    model.compile(
        optimizer="adam",
        loss="mse",
        metrics=[metrics.Hinge(), "mse"],
    )
    X_train = np.random.rand(100, 3)
    y_train = np.random.rand(100, 1)
    model.fit(X_train, y_train)
    path = os.path.join(self.get_temp_dir(), "my_keras_core_model")
    tf.saved_model.save(model, path)
    restored_model = tf.saved_model.load(path)
    self.assertAllClose(
        model(X_train),
        restored_model.signatures["serving_default"](
            tf.convert_to_tensor(X_train, dtype=tf.float32)
        )["output_0"],
        rtol=1e-4,
        atol=1e-4,
    )