tf.compat.v1.flags.mark_bool_flags_as_mutual_exclusive

Ensures that only one flag among flag_names is True.

flag_names [str | FlagHolder], names or holders of flags. Positional-only parameter.
required bool. If true, exactly one flag must be True. Otherwise, at most one flag can be True, and it is valid for all flags to be False.
flag_values flags.FlagValues, optional FlagValues instance where the flags are defined.

ValueError Raised when multiple FlagValues are used in the same invocation. This can occur when FlagHolders have different _flagvalues or when str-type flag_names entries are present and the flag_values argument does not match that of provided FlagHolder(s).