Skip to content

Commit a187f1b

Browse files
Docs: fix docstring argument ordering in dataset module. (#8860)
Co-authored-by: Nicolas Hug <[email protected]>
1 parent b199170 commit a187f1b

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

torchvision/datasets/mnist.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class MNIST(VisionDataset):
2525
and ``MNIST/raw/t10k-images-idx3-ubyte`` exist.
2626
train (bool, optional): If True, creates dataset from ``train-images-idx3-ubyte``,
2727
otherwise from ``t10k-images-idx3-ubyte``.
28-
download (bool, optional): If True, downloads the dataset from the internet and
29-
puts it in root directory. If dataset is already downloaded, it is not
30-
downloaded again.
3128
transform (callable, optional): A function/transform that takes in a PIL image
3229
and returns a transformed version. E.g, ``transforms.RandomCrop``
3330
target_transform (callable, optional): A function/transform that takes in the
3431
target and transforms it.
32+
download (bool, optional): If True, downloads the dataset from the internet and
33+
puts it in root directory. If dataset is already downloaded, it is not
34+
downloaded again.
3535
"""
3636

3737
mirrors = [
@@ -209,13 +209,13 @@ class FashionMNIST(MNIST):
209209
and ``FashionMNIST/raw/t10k-images-idx3-ubyte`` exist.
210210
train (bool, optional): If True, creates dataset from ``train-images-idx3-ubyte``,
211211
otherwise from ``t10k-images-idx3-ubyte``.
212-
download (bool, optional): If True, downloads the dataset from the internet and
213-
puts it in root directory. If dataset is already downloaded, it is not
214-
downloaded again.
215212
transform (callable, optional): A function/transform that takes in a PIL image
216213
and returns a transformed version. E.g, ``transforms.RandomCrop``
217214
target_transform (callable, optional): A function/transform that takes in the
218215
target and transforms it.
216+
download (bool, optional): If True, downloads the dataset from the internet and
217+
puts it in root directory. If dataset is already downloaded, it is not
218+
downloaded again.
219219
"""
220220

221221
mirrors = ["http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/"]
@@ -237,13 +237,13 @@ class KMNIST(MNIST):
237237
and ``KMNIST/raw/t10k-images-idx3-ubyte`` exist.
238238
train (bool, optional): If True, creates dataset from ``train-images-idx3-ubyte``,
239239
otherwise from ``t10k-images-idx3-ubyte``.
240-
download (bool, optional): If True, downloads the dataset from the internet and
241-
puts it in root directory. If dataset is already downloaded, it is not
242-
downloaded again.
243240
transform (callable, optional): A function/transform that takes in a PIL image
244241
and returns a transformed version. E.g, ``transforms.RandomCrop``
245242
target_transform (callable, optional): A function/transform that takes in the
246243
target and transforms it.
244+
download (bool, optional): If True, downloads the dataset from the internet and
245+
puts it in root directory. If dataset is already downloaded, it is not
246+
downloaded again.
247247
"""
248248

249249
mirrors = ["http://codh.rois.ac.jp/kmnist/dataset/kmnist/"]
@@ -358,6 +358,9 @@ class QMNIST(MNIST):
358358
for each example is class number (for compatibility with
359359
the MNIST dataloader) or a torch vector containing the
360360
full qmnist information. Default=True.
361+
train (bool,optional,compatibility): When argument 'what' is
362+
not specified, this boolean decides whether to load the
363+
training set or the testing set. Default: True.
361364
download (bool, optional): If True, downloads the dataset from
362365
the internet and puts it in root directory. If dataset is
363366
already downloaded, it is not downloaded again.
@@ -366,9 +369,6 @@ class QMNIST(MNIST):
366369
version. E.g, ``transforms.RandomCrop``
367370
target_transform (callable, optional): A function/transform
368371
that takes in the target and transforms it.
369-
train (bool,optional,compatibility): When argument 'what' is
370-
not specified, this boolean decides whether to load the
371-
training set or the testing set. Default: True.
372372
"""
373373

374374
subsets = {"train": "train", "test": "test", "test10k": "test", "test50k": "test", "nist": "nist"}

torchvision/datasets/moving_mnist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class MovingMNIST(VisionDataset):
1818
split_ratio (int, optional): The split ratio of number of frames. If ``split="train"``, the first split
1919
frames ``data[:, :split_ratio]`` is returned. If ``split="test"``, the last split frames ``data[:, split_ratio:]``
2020
is returned. If ``split=None``, this parameter is ignored and the all frames data is returned.
21-
transform (callable, optional): A function/transform that takes in a torch Tensor
22-
and returns a transformed version. E.g, ``transforms.RandomCrop``
2321
download (bool, optional): If true, downloads the dataset from the internet and
2422
puts it in root directory. If dataset is already downloaded, it is not
2523
downloaded again.
24+
transform (callable, optional): A function/transform that takes in a torch Tensor
25+
and returns a transformed version. E.g, ``transforms.RandomCrop``
2626
"""
2727

2828
_URL = "http://www.cs.toronto.edu/~nitish/unsupervised_video/mnist_test_seq.npy"

torchvision/datasets/oxford_iiit_pet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class OxfordIIITPet(VisionDataset):
2727
transform (callable, optional): A function/transform that takes in a PIL image and returns a transformed
2828
version. E.g, ``transforms.RandomCrop``.
2929
target_transform (callable, optional): A function/transform that takes in the target and transforms it.
30+
transforms (callable, optional): A function/transform that takes input sample
31+
and its target as entry and returns a transformed version.
3032
download (bool, optional): If True, downloads the dataset from the internet and puts it into
3133
``root/oxford-iiit-pet``. If dataset is already downloaded, it is not downloaded again.
3234
"""

0 commit comments

Comments
 (0)