From c850bcc4dc606189c73a0c7c4c1011c5e5e76349 Mon Sep 17 00:00:00 2001 From: Incomplete Date: Sat, 20 Apr 2019 09:47:25 +0800 Subject: [PATCH] The torch tensor and numpy array shares the memory only if the torch tensor is on CPU --- beginner_source/blitz/tensor_tutorial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beginner_source/blitz/tensor_tutorial.py b/beginner_source/blitz/tensor_tutorial.py index b5b75d38775..d1e17f1f08b 100644 --- a/beginner_source/blitz/tensor_tutorial.py +++ b/beginner_source/blitz/tensor_tutorial.py @@ -132,7 +132,8 @@ # Converting a Torch Tensor to a NumPy array and vice versa is a breeze. # # The Torch Tensor and NumPy array will share their underlying memory -# locations, and changing one will change the other. +# locations (if the Torch Tensor is on CPU), and changing one will change +# the other. # # Converting a Torch Tensor to a NumPy Array # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^