tf.compat.v1.flags.mark_flags_as_required  |  TensorFlow v2.16.1 (original) (raw)

tf.compat.v1.flags.mark_flags_as_required

Stay organized with collections Save and categorize content based on your preferences.

Ensures that flags are not None during program execution.

tf.compat.v1.flags.mark_flags_as_required(
    flag_names, flag_values=_flagvalues.FLAGS
)

If your module might be imported by others, and you only wish to make the flag required when the module is directly executed, call this method like this::

if __name__ == '__main__':
  flags.mark_flags_as_required(['flag1', 'flag2', 'flag3'])
  app.run()
Args
flag_names Sequence[str | FlagHolder], names or holders of the flags.
flag_values flags.FlagValues, optional FlagValues instance where the flags are defined.
Raises
AttributeError If any of flag name has not already been defined as a flag.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.