Fix deprecated: type() -> scalar_type() (#18406)
authorGao, Xiang <qasdfgtyuiop@gmail.com>
Mon, 25 Mar 2019 02:40:08 +0000 (19:40 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 25 Mar 2019 02:46:03 +0000 (19:46 -0700)
Summary:
Sorry for not sending these fixes in a single PR. I found this compiler warning when I was working on something else, and I just go to GitHub and modify the file directly for convenience...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18406

Differential Revision: D14594180

Pulled By: soumith

fbshipit-source-id: 92f48513bc62fbe2c67c759d68830a973296e43b

aten/src/ATen/native/Sorting.cpp

index 14132e3..a2b387a 100644 (file)
@@ -231,7 +231,7 @@ Tensor median_cpu(const Tensor& self) {
   }
   auto tmp_values = self.clone().view(-1);
   auto result = at::empty({1}, self.options());
-  AT_DISPATCH_ALL_TYPES(self.type(), "median", [&] {
+  AT_DISPATCH_ALL_TYPES(self.scalar_type(), "median", [&] {
     // note, quick_select is 0 based while kthvalue is not
     int64_t k = (tmp_values.size(0) - 1) / 2;
     auto val_accessor = tmp_values.accessor<scalar_t, 1>();