|View source on GitHub|
Provides a scope in which Pruned layers and models can be deserialized.
If a keras model or layer has been pruned, it needs to be within this scope to be successfully deserialized.
Object of type
CustomObjectScope with pruning objects included.
pruned_model = prune_low_magnitude(model, **self.params) keras.models.save_model(pruned_model, keras_file) with prune_scope(): loaded_model = keras.models.load_model(keras_file)