def test_loading_without_providing_class_fails(self):
    input_data = keras.Input(shape=(1,))
    layer = AddingPreprocessingLayer()
    output = layer(input_data)
    model = keras.Model(input_data, output)
    if (not tf.executing_eagerly()):
        self.evaluate(tf.compat.v1.variables_initializer(model.variables))
    output_path = os.path.join(self.get_temp_dir(), 'tf_keras_saved_model')
    model.save(output_path, save_format='tf')
    with self.assertRaisesRegex(RuntimeError, 'Unable to restore a layer of'):
        _ = keras.models.load_model(output_path)
def test_loading_without_providing_class_fails(self):
    input_data = keras.Input(shape=(1,))
    layer = AddingPreprocessingLayer()
    output = layer(input_data)
    model = keras.Model(input_data, output)
    if (not tf.executing_eagerly()):
        self.evaluate(tf.compat.v1.variables_initializer(model.variables))
    output_path = os.path.join(self.get_temp_dir(), 'tf_keras_saved_model')
    model.save(output_path, save_format='tf')
    with self.assertRaisesRegex(RuntimeError, 'Unable to restore a layer of'):
        _ = keras.models.load_model(output_path)