zero.data¶
Missing batteries from torch.utils.data
.
Enumerate¶
-
class
zero.data.
Enumerate
(dataset)[source]¶ Make dataset return both indices and items.
Tutorial
from torch.utils.data import DataLoader, TensorDataset dataset = TensorDataset(torch.randn(9, 2), torch.randn(9)) # X, y for batch_idx, batch in DataLoader(Enumerate(dataset), batch_size=3): print(batch_idx)
tensor([0, 1, 2]) tensor([3, 4, 5]) tensor([6, 7, 8])
Access the underlying dataset. |
|
Get the length of the underlying dataset. |
|
|
Return index and the corresponding item from the underlying dataset. |
functions¶
|
Almost an alias for |
|
Concatenate items of the iterable along the first dimension. |
|
Make |
|
Efficiently iterate over data in a batchwise manner. |