Ok, thanks. By the way, just to make sure neither of us is misinterpreting the other’s terminology: since my data is time series, I was using the term “sample” to refer to a single measurement element of one or more time series (equivalent to one pixel for image data). But I want to train on a segment (or batch of segments) of, say, one second of continuous samples (equivalent to one image). I’ll refer to each element of a batch is a time segment.
So if I make the Dataset return a whole batch, as you describe, is it possible to have the Dataset make the batch out of multiple time segments, where the segments aren’t continuous with each other (but the samples within each segment are), and avoid copying?