Skip to content

Tag: pytorch

The shuffling order of DataLoader in pytorch

I am really confused about the shuffle order of DataLoader in pytorch. Supposed I have a dataset: In scenario I, the code is: the shuffling result is 0,4,2,3,1. In scenario II, the code is: the shuffling result is 1,3,4,0,2. In scenario III, the code is: the shuffling result is 4,1,3,0,2. Can someone explain …

Select pytorch tensor elements by list of indices

I guess I have a pretty simple problem. Let’s take the following tensor of length 6 Now I would like to to access only the elements at specific indices, lets say at [0, 3, 4]. So I would like to return I found torch.index_select which worked great for a tensor of two dimensions, e.g. dimension (2, 4), b…