tests/testthat/test-snapshot.R

test_that("dataset_snapshot works", {

  skip_if(tf_version() < "2.3")
  fi <- tempfile()

  res <- tensor_slices_dataset(1:10) %>%
    dataset_snapshot(fi) %>%
    reticulate::as_iterator() %>%
    reticulate::iterate()

  expect_length(res, 10)
  expect(length(dir(fi)) > 0, "snapshots not found")
})

Try the tfdatasets package in your browser

Any scripts or data that you put into this service are public.

tfdatasets documentation built on Sept. 11, 2024, 8:53 p.m.