|
33 | 33 | from ..types import TypeTripletInt |
34 | 34 | from ..utils import get_stem |
35 | 35 | from ..utils import guess_external_viewer |
36 | | -from ..utils import in_torch_loader |
37 | 36 | from ..utils import is_iterable |
38 | 37 | from ..utils import to_tuple |
39 | 38 | from .io import check_uint_to_int |
@@ -179,7 +178,6 @@ def __init__( |
179 | 178 | warnings.warn(message, FutureWarning, stacklevel=2) |
180 | 179 |
|
181 | 180 | super().__init__(**kwargs) |
182 | | - self._check_data_loader() |
183 | 181 | self.path = self._parse_path(path, verify=verify_path) |
184 | 182 |
|
185 | 183 | self[PATH] = '' if self.path is None else str(self.path) |
@@ -238,20 +236,6 @@ def __copy__(self): |
238 | 236 | ) |
239 | 237 | return new_image |
240 | 238 |
|
241 | | - @staticmethod |
242 | | - def _check_data_loader() -> None: |
243 | | - if torch.__version__ >= '2.3' and in_torch_loader(): |
244 | | - message = ( |
245 | | - 'Using TorchIO images without a torchio.SubjectsLoader in PyTorch >=' |
246 | | - ' 2.3 might have unexpected consequences, e.g., the collated batches' |
247 | | - ' will be instances of torchio.Subject with 5D images. Replace' |
248 | | - ' your PyTorch DataLoader with a torchio.SubjectsLoader so that' |
249 | | - ' the collated batch becomes a dictionary, as expected. See' |
250 | | - ' https://github.com/TorchIO-project/torchio/issues/1179 for more' |
251 | | - ' context about this issue.' |
252 | | - ) |
253 | | - warnings.warn(message, stacklevel=1) |
254 | | - |
255 | 239 | @property |
256 | 240 | def data(self) -> torch.Tensor: |
257 | 241 | """Tensor data (same as :class:`Image.tensor`).""" |
|
0 commit comments