From 58f3712cebc26564a675f82bde6a8d318529dd48 Mon Sep 17 00:00:00 2001 From: Vitaly Fedyunin Date: Wed, 27 Mar 2019 14:44:00 -0700 Subject: [PATCH] Clarify error text of the pin_memory function Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18530 Reviewed By: ezyang Differential Revision: D14647578 Pulled By: VitalyFedyunin fbshipit-source-id: ddd70240d52d2e9a96e26f5a0dfea8d76fe25078 --- aten/src/ATen/native/Memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aten/src/ATen/native/Memory.cpp b/aten/src/ATen/native/Memory.cpp index 6985d75..5717735 100644 --- a/aten/src/ATen/native/Memory.cpp +++ b/aten/src/ATen/native/Memory.cpp @@ -9,7 +9,7 @@ namespace native { Tensor pin_memory(const Tensor& self) { if (self.type().backend() != Backend::CPU) { - AT_ERROR("cannot pin '", self.type().toString(), "' only CPU memory can be pinned"); + AT_ERROR("cannot pin '", self.type().toString(), "' only dense CPU tensors can be pinned"); } auto* allocator = detail::getCUDAHooks().getPinnedMemoryAllocator(); auto tensor = self.type().tensorWithAllocator(self.sizes(), self.strides(), allocator); -- 2.7.4