提交 12993913 编写于 作者: Tongzhou Wang's avatar Tongzhou Wang 提交者: Soumith Chintala

[v1.2.0] Slightly improve dataloader docs on when auto-batching is disabled (#23672)

* Slightly improve dataloader docs on when auto-batching is disabled

* fix typo
上级 bb4ff00f
......@@ -172,9 +172,10 @@ better to not use automatic batching (where :attr:`collate_fn` is used to
collate the samples), but let the data loader directly return each member of
the :attr:`dataset` object.
When both :attr:`batch_size` and :attr:`batch_sampler` are ``None``, automatic
batching is disabled. Each sample obtained from the :attr:`dataset` is
processed with the function passed as the :attr:`collate_fn` argument.
When both :attr:`batch_size` and :attr:`batch_sampler` are ``None`` (default
value for :attr:`batch_sampler` is already ``None``), automatic batching is
disabled. Each sample obtained from the :attr:`dataset` is processed with the
function passed as the :attr:`collate_fn` argument.
**When automatic batching is disabled**, the default :attr:`collate_fn` simply
converts NumPy arrays into PyTorch Tensors, and keeps everything else untouched.
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册