obsslices
(
batch
,
batchdim
=
BatchDimLast
(
)
)
Iterate over views of all observations in a
batch
.
batch
can be a batched array, a tuple of batches, or a
dict of batches
.
batch
=
rand
(
10
,
10
,
4
) # batch size is 4
iter
=
obsslices
(
batch
,
BatchDimLast
(
)
)
@assert
size
(
first
(
iter
)
)
==
(
10
,
10
)
iter2
=
obsslices
(
batch
,
BatchDimFirst
(
)
)
@assert
size
(
first
(
iter
)
)
==
(
10
,
4
)