I get proper output tensors rather. However I am testing this dataset outside seperately and in my actual code it is wrapped by another dataset. But still, the final traceback is upto this dataset (and the index at which it shows error is valid when I test this dataset separately) hence I am unable to understand the problem.