Skip to content

Commit 426976d

Browse files
nightcitybladenightcitybladevfdev-5
authored
docs: clarify _prepare_batch docstring (#3730)
Fixes #2661 Description: - clarify that `_prepare_batch` moves the batch to the target device for both training and evaluation Check list: - [ ] New tests are added (if a new feature is added) - [ ] New doc strings: description and/or example code are in RST format - [ ] Documentation is updated (if required) Co-authored-by: nightcityblade <nightcityblade@gmail.com> Co-authored-by: vfdev <vfdev.5@gmail.com>
1 parent 6c3dfd9 commit 426976d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ignite/engine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
def _prepare_batch(
4848
batch: Sequence[torch.Tensor], device: str | torch.device | None = None, non_blocking: bool = False
4949
) -> tuple[torch.Tensor | Sequence | Mapping | str | bytes, ...]:
50-
"""Prepare batch for training or evaluation: pass to a device with options."""
50+
"""Prepare batch for training or evaluation by moving it to a device with options."""
5151
x, y = batch
5252
return (
5353
convert_tensor(x, device=device, non_blocking=non_blocking),

0 commit comments

Comments
 (0)