I’ve a Tensor of shape torch.Size([1291162, 28, 28, 1]). Since this tensor is so big, i decided to take a batch out of it.
yr = x_train[::6400]
print(yr.shape)

This gives back a Tensor of shape
torch.Size([202, 28, 28, 1])

In my train module, i do this
for t in range(2):
    y_pred = model(yr.float())

I want to extract such tensors efficiently in the for loop so that it can be fed to the model. Like I want to grab unique yr like Tensors every time the loop starts and needs to be fed to model accordingly.