Represents options for tf.data.Dataset. An `Options` object can be, for instance, used to control which static optimizations to apply or whether to use performance modeling to dynamically tune the parallelism of operations such as `tf.data.Dataset.map` or `tf.data.Dataset.interleave`.
| 2295 | |
| 2296 | @tf_export("data.Options") |
| 2297 | class Options(options_lib.OptionsBase): |
| 2298 | """Represents options for tf.data.Dataset. |
| 2299 | |
| 2300 | An `Options` object can be, for instance, used to control which static |
| 2301 | optimizations to apply or whether to use performance modeling to dynamically |
| 2302 | tune the parallelism of operations such as `tf.data.Dataset.map` or |
| 2303 | `tf.data.Dataset.interleave`. |
| 2304 | """ |
| 2305 | |
| 2306 | experimental_deterministic = options_lib.create_option( |
| 2307 | name="experimental_deterministic", |
| 2308 | ty=bool, |
| 2309 | docstring= |
| 2310 | "Whether the outputs need to be produced in deterministic order. If None," |
| 2311 | " defaults to True.") |
| 2312 | |
| 2313 | experimental_distribute = options_lib.create_option( |
| 2314 | name="experimental_distribute", |
| 2315 | ty=distribute_options.DistributeOptions, |
| 2316 | docstring= |
| 2317 | "The distribution strategy options associated with the dataset. See " |
| 2318 | "`tf.data.experimental.DistributeOptions` for more details.", |
| 2319 | default_factory=distribute_options.DistributeOptions) |
| 2320 | |
| 2321 | experimental_optimization = options_lib.create_option( |
| 2322 | name="experimental_optimization", |
| 2323 | ty=optimization_options.OptimizationOptions, |
| 2324 | docstring= |
| 2325 | "The optimization options associated with the dataset. See " |
| 2326 | "`tf.data.experimental.OptimizationOptions` for more details.", |
| 2327 | default_factory=optimization_options.OptimizationOptions) |
| 2328 | |
| 2329 | experimental_slack = options_lib.create_option( |
| 2330 | name="experimental_slack", |
| 2331 | ty=bool, |
| 2332 | docstring="Whether to introduce 'slack' in the last `prefetch` of the " |
| 2333 | "input pipeline, if it exists. This may reduce CPU contention with " |
| 2334 | "accelerator host-side activity at the start of a step. The slack " |
| 2335 | "frequency is determined by the number of devices attached to this " |
| 2336 | "input pipeline. If None, defaults to False.") |
| 2337 | |
| 2338 | experimental_stats = options_lib.create_option( |
| 2339 | name="experimental_stats", |
| 2340 | ty=stats_options.StatsOptions, |
| 2341 | docstring= |
| 2342 | "The statistics options associated with the dataset. See " |
| 2343 | "`tf.data.experimental.StatsOptions` for more details.", |
| 2344 | default_factory=stats_options.StatsOptions) |
| 2345 | |
| 2346 | experimental_threading = options_lib.create_option( |
| 2347 | name="experimental_threading", |
| 2348 | ty=threading_options.ThreadingOptions, |
| 2349 | docstring= |
| 2350 | "The threading options associated with the dataset. See " |
| 2351 | "`tf.data.experimental.ThreadingOptions` for more details.", |
| 2352 | default_factory=threading_options.ThreadingOptions) |
| 2353 | |
| 2354 | experimental_stateful_whitelist = options_lib.create_option( |