# tf.compat.v1.flags.declare_key_flag

<br />

Declares one flag as key to the current module.

    tf.compat.v1.flags.declare_key_flag(
        flag_name: Union[Text, https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/compat/v1/flags/FlagHolder],
        flag_values: https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/compat/v1/flags/FlagValues = _flagvalues.FLAGS
    ) -> None

Key flags are flags that are deemed really important for a module.
They are important when listing help messages; e.g., if the
--helpshort command-line flag is used, then only the key flags of the
main module are listed (instead of all flags, as in the case of
--helpfull).

Sample usage::

    flags.declare_key_flag('flag_1')

<br />

<br />

<br />

| ## Args ||
|---|---|
| `flag_name` | str \| :class:`FlagHolder`, the name or holder of an already declared flag. (Redeclaring flags as key, including flags implicitly key because they were declared in this module, is a no-op.) Positional-only parameter. |
| `flag_values` | :class:`FlagValues`, the FlagValues instance in which the flag will be declared as a key flag. This should almost never need to be overridden. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | Raised if flag_name not defined as a Python flag. |

<br />