From: Vitaly Fedyunin Date: Wed, 27 Mar 2019 21:44:00 +0000 (-0700) Subject: Clarify error text of the pin_memory function X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~591 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58f3712cebc26564a675f82bde6a8d318529dd48;p=platform%2Fupstream%2Fpytorch.git 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 --- 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);