tf.keras.losses.serialize

Serializes loss function or Loss instance.

loss A Keras Loss instance or a loss function.
use_legacy_format Boolean, whether to use the legacy serialization format. Defaults to False.

Loss configuration dictionary.