Hello I have a dataset object using torch.utils.data as input. I can access to the input dataset object using index and see they are all tensors.
I want to update some of the values in my input after each iteration based on my algorithm, how do I do that?
I tried the way of modify a tensor as documentation said but the values do not change:
example:
in raw data, I have data[‘img’] and data[‘prob’]
and I use datasets and dataloader function with data tranform.
for i in range(0, len(dataset):
dataset[i][0][‘prob’][0] = calculated_value[i].item(0)
the value won’t change.
Please help! Really appreciated!