Return the data according to the torch.tensor

i have a datalist[0:59]. i used k-folder cross validation, split the data:


But when i try to return the first split for my data, i get error


How can i get the data_list from my tensor

Of yhat types are data_list and train_indices? The first posted list(k) doesn’t seem to be used in the second code snippet.

PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier. :wink:

1 Like

solved by: train_dataset = [data_list[index] for index in train_idx]