tf.compat.v1.flags.EnumParser
Parser of a string enum value (a string value from a given set).
Inherits From: ArgumentParser
tf.compat.v1.flags.EnumParser(
enum_values: Iterable[Text], case_sensitive: bool = True
) -> None
Args |
enum_values
|
[str], a non-empty list of string values in the enum.
|
case_sensitive
|
bool, whether or not the enum is to be case-sensitive.
|
Raises |
ValueError
|
When enum_values is empty.
|
Methods
flag_type
flag_type() -> Text
See base class.
parse
parse(
argument: Text
) -> Text
Determines validity of argument and returns the correct element of enum.
Args |
argument
|
str, the supplied flag value.
|
Returns |
The first matching element from enum_values.
|
Raises |
ValueError
|
Raised when argument didn't match anything in enum.
|
Class Variables |
syntactic_help
|
''
|
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-01-23 UTC.
[null,null,["Last updated 2024-01-23 UTC."],[],[]]