diff --git a/.ci/docker/common/install_pip_requirements.sh b/.ci/docker/common/install_pip_requirements.sh index a548d200462..acd02da24ab 100644 --- a/.ci/docker/common/install_pip_requirements.sh +++ b/.ci/docker/common/install_pip_requirements.sh @@ -4,4 +4,4 @@ set -ex # Install pip packages pip install --upgrade pip -pip install -r ./requirements.txt +pip install --extra-index-url https://pypi.nvidia.com -r ./requirements.txt diff --git a/beginner_source/basics/tensorqs_tutorial.py b/beginner_source/basics/tensorqs_tutorial.py index 30e05cb10d0..55d8b62f084 100644 --- a/beginner_source/basics/tensorqs_tutorial.py +++ b/beginner_source/basics/tensorqs_tutorial.py @@ -44,6 +44,8 @@ # Tensors can be created from NumPy arrays (and vice versa - see :ref:`bridge-to-np-label`). np_array = np.array(data) x_np = torch.from_numpy(np_array) +# Note: torch.from_numpy shares memory with the NumPy array when possible. If you want a copy, use torch.tensor(np_array). +# torch.as_tensor(np_array) also avoids a copy when possible. ###############################################################