Skip to content

Commit

Permalink
Update datasets/doc/source/how-to-use-with-pytorch.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Oct 14, 2023
1 parent 018e46e commit 22f5bf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasets/doc/source/how-to-use-with-pytorch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ That is why we iterate over all the samples from this batch and apply our transf
Alternatively, you can use the `map() <https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map>`_
function. Note that the operation is instant (contrary to the ``set_transform`` and ``with_transform``). Remember that the ``map``
will modify the existing dataset if the key in the dictionary you return is already present and append a new feature if
it did not exist before. Below, we modify the "img" feature of our dataset.::
it did not exist before. Below, we modify the ``"img"`` feature of our dataset.::

from torch.utils.data import DataLoader
from torchvision.transforms import ToTensor
Expand Down

0 comments on commit 22f5bf6

Please sign in to comment.