[feature request] Convert "indices" variable in "torch.utils.data.dataset.random_split" to list #9211
Labels
todo
Not as important as medium or high priority tasks, but we will work on these.
8000
Issue description
random_split fills indices variable using torch.randperm function, which returns tensor. Through Subset class its values goes to Dataset.getitem. If I override getitem, tensor values are ok for indexing list, but with pandas DataFrame it raises TypeError. Maybe it would be better to convert indices to list variable at start.
Code example
df = pd.DataFrame([1, 2])
tn = torch.tensor([0, 1])
df.iloc[tn[0]]
...
...
TypeError: len() of unsized object
The text was updated successfully, but these errors were encountered: