View source: R/dataset_methods.R
dataset_options | R Documentation |
Get or Set Dataset Options
dataset_options(dataset, ...)
dataset |
a tensorflow dataset |
... |
Valid values include:
|
The options are "global" in the sense they apply to the entire dataset. If options are set multiple times, they are merged as long as different options do not use different non-default values.
If values are supplied to ...
, returns a tf.data.Dataset
with the
given options set/updated. Otherwise, returns the currently set options for
the dataset.
## Not run:
# pass options directly:
range_dataset(0, 10) %>%
dataset_options(
experimental_deterministic = FALSE,
threading.private_threadpool_size = 10
)
# pass options as a named list:
opts <- list(
experimental_deterministic = FALSE,
threading.private_threadpool_size = 10
)
range_dataset(0, 10) %>%
dataset_options(opts)
# pass a tf.data.Options() instance
opts <- tf$data$Options()
opts$experimental_deterministic <- FALSE
opts$threading$private_threadpool_size <- 10L
range_dataset(0, 10) %>%
dataset_options(opts)
# get currently set options
range_dataset(0, 10) %>% dataset_options()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.