Properly dispatch s_copy__cpu.
authorGregory Chanan <gchanan@fb.com>
Tue, 12 Feb 2019 20:13:11 +0000 (12:13 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 12 Feb 2019 20:53:36 +0000 (12:53 -0800)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16974

Differential Revision: D14030516

Pulled By: gchanan

fbshipit-source-id: ba4cde5ebf2898d207efbc9117c1f1d6ccae861b

aten/src/ATen/native/Copy.cpp

index a27e33e..871c274 100644 (file)
@@ -38,7 +38,7 @@ namespace at {
 namespace native {
 
 Tensor& _s_copy__cpu(Tensor& self, const Tensor& src, bool non_blocking) {
-  if (src.is_cuda()) {
+  if (src.type_id() != CPUTensorId()) {
     _s_copy_from(src, self, non_blocking);
     return self;
   }