Skip to content

do not pin memory when device is CPU to avoid warning#1400

Open
pedrormjunior wants to merge 1 commit intoJaidedAI:masterfrom
pedrormjunior:fix_pin_memory_warning
Open

do not pin memory when device is CPU to avoid warning#1400
pedrormjunior wants to merge 1 commit intoJaidedAI:masterfrom
pedrormjunior:fix_pin_memory_warning

Conversation

@pedrormjunior
Copy link

This seems to fix issue #854.

Without this modification, it raises the following warning:

/path/to/.venv/lib/python3.13/site-packages/torch/utils/data/dataloader.py:665: UserWarning: 'pin_memory' argument is set as true but no accelerator is found, then device pinned memory won't be used.
  warnings.warn(warn_msg)

I did not think about collateral effects of this change, other use cases, etc. Please, check.

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