[BUG] TensorDict.to
moves all tensors to cuda:0
if index not specified
#1158
Labels
bug
Something isn't working
Describe the bug
When moving a
TensorDict
to a CUDA device whose index is not specified,tensordict
moves it tocuda:0
, where it should be moved to the current device as selected bytorch.cuda.current_device()
ortorch.cuda.get_node_local_rank()
.To Reproduce
Reason and Possible fixes
The bug appears at
tensordict/tensordict/utils.py
Line 1393 in d1363eb
It should be changed to
Checklist
The text was updated successfully, but these errors were encountered: