Skip to content

Commit

Permalink
fix: import T_co from torch
Browse files Browse the repository at this point in the history
  • Loading branch information
flxst committed Nov 6, 2024
1 parent 7f85f33 commit 787099d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modalities/dataloader/dataloader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from typing import Iterable, Optional, Union

from torch.utils.data import Dataset, DistributedSampler, Sampler
from torch.utils.data.dataloader import DataLoader, T_co, _collate_fn_t, _worker_init_fn_t
from torch.utils.data.dataloader import DataLoader, _collate_fn_t, _worker_init_fn_t

try: # torch <= 2.4
from torch.utils.data.dataloader import T_co
except ImportError: # torch >= 2.5
from torch.utils.data.dataloader import _T_co as T_co

from modalities.dataloader.samplers import ResumableBatchSampler

Expand Down

0 comments on commit 787099d

Please sign in to comment.