# \donttest{
n <- 128L
x <- matrix(runif(4 * n), 4, n) # [4, 128] col-major
y <- matrix(runif(2 * n), 2, n)
dl <- ag_dataloader(x, y, batch_size = 32L)
dl$reset()
while (dl$has_next()) {
batch <- dl$next_batch()
# batch$x: [4, 32], batch$y: [2, 32]
}
# }
Run the code above in your browser using DataLab