Thank you very much. I create two empty list and in an iterative procedure append every data to first list and its target to second. Say, features=[tensor_1, tensor_2, …] and targets=[label_of_tensor_1, label_of_tensor_2, …]. Then I use TensorDataset(features, targets). Is this a correct way? I give an Error: “valueerror: only one element tensors can be converted to python scalars”! Can you help me more?