Register image specific flags. Args: data_format: Create a flag to specify image axis convention. Returns: A list of flags for core.py to marks as key flags.
(data_format=True)
| 20 | |
| 21 | |
| 22 | def define_image(data_format=True): |
| 23 | """Register image specific flags. |
| 24 | |
| 25 | Args: |
| 26 | data_format: Create a flag to specify image axis convention. |
| 27 | |
| 28 | Returns: |
| 29 | A list of flags for core.py to marks as key flags. |
| 30 | """ |
| 31 | |
| 32 | key_flags = [] |
| 33 | |
| 34 | if data_format: |
| 35 | flags.DEFINE_enum( |
| 36 | name="data_format", |
| 37 | short_name="df", |
| 38 | default=None, |
| 39 | enum_values=["channels_first", "channels_last"], |
| 40 | help=help_wrap( |
| 41 | "A flag to override the data format used in the model. " |
| 42 | "channels_first provides a performance boost on GPU but is not " |
| 43 | "always compatible with CPU. If left unspecified, the data format " |
| 44 | "will be chosen automatically based on whether TensorFlow was " |
| 45 | "built for CPU or GPU.")) |
| 46 | key_flags.append("data_format") |
| 47 | |
| 48 | return key_flags |
nothing calls this directly
no test coverage detected