MLDataPattern.jl icon indicating copy to clipboard operation
MLDataPattern.jl copied to clipboard

`nobs(::BatchView)` behavior

Open lorenzoh opened this issue 4 years ago • 0 comments
trafficstars

Raising this issue prompted by this Discourse post which led me to uncover that nobs(::BatchView) returns not the number of batches, but the number of wrapped observations. This is in contrast to DataLoaders.jl's BatchViewCollated which treats every batch as an observation, since this is the relevant information for constructing the appropriate number of buffers. (It always uses data containers, not data iterators, so length is not always defined.)

If this behavior is intended, then DataLoaders.jl can switch to using length (with nobs as fallback). Just wanted to get an opinion on this.

lorenzoh avatar Jun 15 '21 09:06 lorenzoh