I am using a code that trains neural networks. The code uses the DataLoader of PyTorch to load the data for every iteration. The code looks as follows
for step, data in enumerate(dataloader, 0):
............................................................
output = neuralnetwork_model(data)
.............................................................
Here the step is an integer that gives values 0, 1, 2, 3, ....... and data gives a batch of samples at each step. The code passes corresponding batches to the neural network at each step.
I need to just access the data of step n+1 at step n. I need something like this
for step, data in enumerate(dataloader, 0):
............................................................
output = neuralnetwork_model(data)
access = data_of_next_step
.............................................................
How can I achieve this?