Watch talks from the 2019 TensorFlow Dev Summit Watch now

tf.keras.losses.serialize

tf.keras.losses.serialize(loss)

Defined in tensorflow/python/keras/losses.py.