Skip to content

Commit 51a4901

Browse files
Improvements to implementation of str method for datamodule
Corrected the annotation for the internal function and the list that is suppsoed to store the information on the datasets
1 parent 9acf680 commit 51a4901

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lightning/pytorch/core/datamodule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import inspect
1717
import os
18-
from typing import IO, Any, Dict, Iterable, Optional, Union, cast
18+
from typing import IO, Any, Dict, Iterable, List, Optional, Union, cast
1919

2020
from lightning_utilities import apply_to_collection
2121
from torch.utils.data import DataLoader, Dataset, IterableDataset
@@ -252,9 +252,9 @@ def __str__(self) -> str:
252252
A string representation of the datasets that are setup.
253253
254254
"""
255-
datasets_info: Optional[str] = []
255+
datasets_info: Optional[List[str]] = []
256256

257-
def len_implemented(obj):
257+
def len_implemented(obj: Dataset) -> bool:
258258
try:
259259
len(obj)
260260
return True

0 commit comments

Comments
 (0)