Skip to content

Instantly share code, notes, and snippets.

@Cospel
Created January 17, 2020 13:16
Show Gist options
  • Select an option

  • Save Cospel/aa2257d38b17a1624b0662661033d22c to your computer and use it in GitHub Desktop.

Select an option

Save Cospel/aa2257d38b17a1624b0662661033d22c to your computer and use it in GitHub Desktop.
preprocess_layer.py
class PreprocessTFLayer(tf.keras.layers.Layer):
def __init__(self, name="preprocess_tf", **kwargs):
super(PreprocessTFLayer, self).__init__(name=name, **kwargs)
self.preprocess = preprocess_tf
def call(self, input):
return self.preprocess(input)
def get_config(self):
config = super(PreprocessTFLayer, self).get_config()
return config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment