add cifar document

This commit is contained in:
Dun Liang 2021-06-16 17:53:24 +08:00
parent 16af6e7f8e
commit e160a83a7e
3 changed files with 24 additions and 3 deletions

View File

@ -9,7 +9,7 @@
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.2.3.28'
__version__ = '1.2.3.29'
from jittor_utils import lock
with lock.lock_scope():
ori_int = int

View File

@ -98,6 +98,16 @@ class CIFAR10(Dataset):
puts it in root directory. If dataset is already downloaded, it is not
downloaded again.
Example::
from jittor.dataset.cifar import CIFAR10
a = CIFAR10()
a.set_attr(batch_size=16)
for imgs, labels in a:
print(imgs.shape, labels.shape)
break
"""
base_folder = 'cifar-10-batches-py'
url = "https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz"
@ -225,6 +235,17 @@ class CIFAR100(CIFAR10):
"""`CIFAR100 <https://www.cs.toronto.edu/~kriz/cifar.html>`_ Dataset.
This is a subclass of the `CIFAR10` Dataset.
Example::
from jittor.dataset.cifar import CIFAR100
a = CIFAR100()
a.set_attr(batch_size=16)
for imgs, labels in a:
print(imgs.shape, labels.shape)
break
"""
base_folder = 'cifar-100-python'
url = "https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz"

View File

@ -166,8 +166,8 @@ class TestDatasetSeed(unittest.TestCase):
from jittor.dataset.cifar import CIFAR10
a = CIFAR10()
a.set_attr(batch_size=16)
for imgs, lables in a:
print(imgs.shape)
for imgs, labels in a:
print(imgs.shape, labels.shape)
break