sampler ( Sampler , optional ) – defines the strategy to draw samples from the dataset. If specified,
shuffle must be
but I want it to work with multithreading properly. My data-set is a data-set of data sets so I want to create a sampler that simply sampled my meta set correctly.
e.g. tensor of size M K*N C H W
The sampler will return indices, which will be passed to the
The returned tensor shape from your dataset is thus unrelated to the sampler.
You can see the implementations (and the return values in
__iter__) for the samplers here.
If your tensors are stored in the specified shape
[M, K*N, C, H, W] inside your
Dataset, you should be able to return them in this shape.
DataLoader would add a batch dimension to these tensors. I don’t know what the specified shapes mean, but if
N is the batch size, you could set
batch_size=1 in the
squeeze dim0 in the
This is for N-way K-shot learning.
So (meta) batch size is