Clarify error text of the pin_memory function
authorVitaly Fedyunin <vitalyf@fb.com>
Wed, 27 Mar 2019 21:44:00 +0000 (14:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 27 Mar 2019 21:56:29 +0000 (14:56 -0700)
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

index 6985d75..5717735 100644 (file)
@@ -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);