rstudio / tfdatasets

R interface to TensorFlow Datasets API
https://tensorflow.rstudio.com/tools/tfdatasets/
34 stars 12 forks source link

reexport iterators helpers from reticulate #38

Closed dfalbel closed 2 years ago

dfalbel commented 5 years ago

Since in tf 2.0 are iterators it's helpful to directly reexport the reticulate helper funs so we can do:

library(tfdatasets)
it <- range_dataset(1, 100) %>% 
  dataset_batch(10) %>% 
  as_iterator()

while(!is.null(x <- iter_next(it))) {
  str(x)
}