|
16 | 16 | import inspect
|
17 | 17 | from typing import IO, Any, Dict, Iterable, Optional, Union, cast
|
18 | 18 |
|
19 |
| -import pytorch_lightning as pl |
20 |
| -from lightning_fabric.utilities.types import _MAP_LOCATION_TYPE, _PATH |
21 | 19 | from lightning_utilities import apply_to_collection
|
22 |
| -from pytorch_lightning.core.hooks import DataHooks |
23 |
| -from pytorch_lightning.core.mixins import HyperparametersMixin |
24 |
| -from pytorch_lightning.core.saving import _load_from_checkpoint |
25 |
| -from pytorch_lightning.utilities.model_helpers import _restricted_classmethod |
26 |
| -from pytorch_lightning.utilities.types import EVAL_DATALOADERS, TRAIN_DATALOADERS |
27 | 20 | from torch.utils.data import DataLoader, Dataset, IterableDataset
|
28 | 21 | from typing_extensions import Self
|
29 | 22 |
|
| 23 | +import lightning.pytorch as pl |
| 24 | +from lightning.fabric.utilities.types import _MAP_LOCATION_TYPE, _PATH |
| 25 | +from lightning.pytorch.core.hooks import DataHooks |
| 26 | +from lightning.pytorch.core.mixins import HyperparametersMixin |
| 27 | +from lightning.pytorch.core.saving import _load_from_checkpoint |
| 28 | +from lightning.pytorch.utilities.model_helpers import _restricted_classmethod |
| 29 | +from lightning.pytorch.utilities.types import EVAL_DATALOADERS, TRAIN_DATALOADERS |
| 30 | + |
30 | 31 |
|
31 | 32 | class LightningDataModule(DataHooks, HyperparametersMixin):
|
32 | 33 | """A DataModule standardizes the training, val, test splits, data preparation and transforms. The main advantage is
|
33 | 34 | consistent data splits, data preparation and transforms across models.
|
34 | 35 |
|
35 | 36 | Example::
|
36 | 37 |
|
37 |
| - import lightning.pytorch as L |
| 38 | + import lightning as L |
38 | 39 | import torch.utils.data as data
|
39 |
| - from pytorch_lightning.demos.boring_classes import RandomDataset |
| 40 | + from lightning.pytorch.demos.boring_classes import RandomDataset |
40 | 41 |
|
41 | 42 | class MyDataModule(L.LightningDataModule):
|
42 | 43 | def prepare_data(self):
|
|
0 commit comments