<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/core/registry.py#L18-L62) |

Register decorated function or class to collection.

    tfm.core.registry.register(
        registered_collection, reg_key
    )

Register decorated function or class into registered_collection, in a
hierarchical order. For example, when reg_key="my_model/my_exp/my_config_0"
the decorated function or class is stored under
registered_collection\["my_model"\]\["my_exp"\]\["my_config_0"\].
This decorator is supposed to be used together with the lookup() function in
this file.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `registered_collection` | a dictionary. The decorated function or class will be put into this collection. |
| `reg_key` | The key for retrieving the registered function or class. If reg_key is a string, it can be hierarchical like my_model/my_exp/my_config_0 |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A decorator function ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `KeyError` | when function or class to register already exists. |

<br />