I am trying to create a Dataloader using the built-in DataLoader class from a dataset created using the built-in Dataset class, the problem is that the tensor in the DataLoader reverts to reqiures_grad=False. I think the DataLoader class makes a copy or something, what might be the best way of going around this?.
so I changed it to the inplace ops: tensor.requires_grad_().
Also, you are passing the _data tensor (not the dataDataset) to the DataLoader, which you also might want to change.