MLDataPattern.jl
MLDataPattern.jl copied to clipboard
`nobs(::BatchView)` behavior
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.