# tf.keras.utils.register_keras_serializable

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/keras/utils/generic_utils.py#L134-L180) |

Registers an object with the Keras serialization framework.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.utils.register_keras_serializable`](https://www.tensorflow.org/api_docs/python/tf/keras/utils/register_keras_serializable)

<br />

    tf.keras.utils.register_keras_serializable(
        package='Custom', name=None
    )

This decorator injects the decorated class or function into the Keras custom
object dictionary, so that it can be serialized and deserialized without
needing an entry in the user-provided custom object dict. It also injects a
function that Keras will call to get the object's serializable string key.

Note that to be serialized and deserialized, classes must implement the
`get_config()` method. Functions do not have this requirement.

The object will be registered under the key 'package\>name' where `name`,
defaults to the object name if not passed.

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `package` | The package that this class belongs to. |
| `name` | The name to serialize this class under in this package. If None, the class's name will be used. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A decorator that registers the decorated class with the passed names. ||

<br />