| View source on GitHub | 
Serializes a Layer object into a JSON-compatible representation.
tf.keras.layers.serialize(
    layer
)
   
| Args | |
|---|---|
| layer | The Layerobject to serialize. | 
| Returns | |
|---|---|
| A JSON-serializable dict representing the object's config. | 
from pprint import pprint model = tf.keras.models.Sequential() model.add(tf.keras.Input(shape=(16,))) model.add(tf.keras.layers.Dense(32, activation='relu')) pprint(tf.keras.layers.serialize(model)) # prints the configuration of the model, as a dict.
    © 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
    https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/keras/layers/serialize