Skip to content

Commit

Permalink
Making root parameter optional for Vision Dataset (#8124)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolas Hug <[email protected]>
Co-authored-by: Nicolas Hug <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent c7e2947 commit 127e8a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchvision/datasets/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class VisionDataset(data.Dataset):
It is necessary to override the ``__getitem__`` and ``__len__`` method.
Args:
root (string): Root directory of dataset.
root (string, optional): Root directory of dataset. Only used for `__repr__`.
transforms (callable, optional): A function/transforms that takes in
an image and a label and returns the transformed versions of both.
transform (callable, optional): A function/transform that takes in an PIL image
Expand All @@ -29,7 +29,7 @@ class VisionDataset(data.Dataset):

def __init__(
self,
root: str,
root: Optional[str] = None,
transforms: Optional[Callable] = None,
transform: Optional[Callable] = None,
target_transform: Optional[Callable] = None,
Expand Down

0 comments on commit 127e8a7

Please sign in to comment.