Skip to content

fix: todevice ignores non_blocking for nested containers - #105

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/device-todevice-ignores-non-blocking-for
Open

fix: todevice ignores non_blocking for nested containers#105
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/device-todevice-ignores-non-blocking-for

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

Problem

fix: todevice ignores non_blocking for nested containers

Fix

Replace:

    if isinstance(batch, dict):
        return {k: todevice(v, device) for k, v in batch.items()}

    if isinstance(batch, (tuple, list)):
        return type(batch)(todevice(x, device) for x in batch)

with:

    if isinstance(batch, dict):
        return {k: todevice(v, device, callback=callback, non_blocking=non_blocking) for k, v in batch.items()}

    if isinstance(batch, (tuple, list)):
        return type(batch)(todevice(x, device, callback=callback, non_blocking=non_blocking) for x in batch)

Files changed

  • dust3r/utils/device.py

Signed-off-by: Andrew White <andrewwhitecdw@users.noreply.github.com>
Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw force-pushed the bugfix/device-todevice-ignores-non-blocking-for branch from 69daee8 to d7877db Compare August 18, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant