Utility Functions
===========================

..
    Comment: the next section will become "DataPipe Graph Visualization and Linter" when linter is added.

DataPipe Graph Visualization
-------------------------------------
.. currentmodule:: torchdata.datapipes.utils

.. autosummary::
    :nosignatures:
    :toctree: generated/
    :template: function.rst

    to_graph

Common Utility Functions
--------------------------------------
.. currentmodule:: torchdata.datapipes.utils

.. autosummary::
    :nosignatures:
    :toctree: generated/
    :template: function.rst

    janitor
    pin_memory_fn


File Object and Stream Utility
-------------------------------------

.. currentmodule:: torchdata.datapipes.utils

.. autosummary::
    :nosignatures:
    :toctree: generated/
    :template: class_template.rst

    StreamWrapper


DataLoader
-------------------------------------

For documentation related to DataLoader, please refer to the
``torch.utils.data`` `documentation <https://pytorch.org/docs/stable/data.html>`_. Or, more specifically, the
`DataLoader API section <https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader>`_.

DataLoader v2 is currently in development. For more information please refer to :doc:`dataloader2`.


Sampler
-------------------------------------

For documentation related to Sampler, please refer to the
``torch.utils.data``
`documentation on Data Loading order <https://pytorch.org/docs/stable/data.html#data-loading-order-and-sampler>`_.
The Sampler API section is `here <https://pytorch.org/docs/stable/data.html#torch.utils.data.Sampler>`_.