Skip to content

Commit 63d6601

Browse files
qwfysoumith
authored andcommitted
The torch tensor and numpy array shares the memory only if the torch tensor is on CPU (#485)
1 parent 5ef8df5 commit 63d6601

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

beginner_source/blitz/tensor_tutorial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
# Converting a Torch Tensor to a NumPy array and vice versa is a breeze.
133133
#
134134
# The Torch Tensor and NumPy array will share their underlying memory
135-
# locations, and changing one will change the other.
135+
# locations (if the Torch Tensor is on CPU), and changing one will change
136+
# the other.
136137
#
137138
# Converting a Torch Tensor to a NumPy Array
138139
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)