tf.compat.v1.flags.EnumClassParser

Parser of an Enum class member.

Inherits From: ArgumentParser

Args
enum_class class, the Enum class with all possible flag values.
case_sensitive bool, whether or not the enum is to be case-sensitive. If False, all member names must be unique when case is ignored.
Raises
TypeError When enum_class is not a subclass of Enum.
ValueError When enum_class is empty.
Attributes
member_names The accepted enum names, in lowercase if not case sensitive.

Methods

flag_type

See base class.

parse

Determines validity of argument and returns the correct element of enum.

Args
argument str or Enum class member, the supplied flag value.
Returns
The first matching Enum class member in Enum class.
Raises
ValueError Raised when argument didn't match anything in enum.
Class Variables
syntactic_help ''

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/compat/v1/flags/EnumClassParser