Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Tensor.type(dtype) not preserving device#7474

Merged
colesbury merged 1 commit into
pytorch:masterfrom
colesbury:type_device
May 10, 2018
Merged

Fix Tensor.type(dtype) not preserving device#7474
colesbury merged 1 commit into
pytorch:masterfrom
colesbury:type_device

Conversation

@colesbury
Copy link
Copy Markdown
Member

Note that Tensor.cuda() will stil copy the tensor to the current device
if it's a CUDA tensor on a different device.

Fixes #7441

Note that Tensor.cuda() will stil copy the tensor to the current device
if it's a CUDA tensor on a different device.

Fixes pytorch#7441
@colesbury
Copy link
Copy Markdown
Member Author

cc @ngimel

Copy link
Copy Markdown
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, nice that we aren't overloading -1 as much anymore.

@colesbury colesbury merged commit 6c7a831 into pytorch:master May 10, 2018
onnxbot added a commit to onnxbot/onnx-fb-universe that referenced this pull request May 10, 2018
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
Note that Tensor.cuda() will stil copy the tensor to the current device
if it's a CUDA tensor on a different device.

Fixes pytorch#7441
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Note that Tensor.cuda() will stil copy the tensor to the current device
if it's a CUDA tensor on a different device.

Fixes pytorch#7441
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.

2 participants