From 5acac411e4eb682019fc093f8c32b59d4b9fb82c Mon Sep 17 00:00:00 2001 From: "Gao, Xiang" Date: Sun, 24 Mar 2019 19:40:08 -0700 Subject: [PATCH] Fix deprecated: type() -> scalar_type() (#18406) 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aten/src/ATen/native/Sorting.cpp b/aten/src/ATen/native/Sorting.cpp index 14132e3..a2b387a 100644 --- a/aten/src/ATen/native/Sorting.cpp +++ b/aten/src/ATen/native/Sorting.cpp @@ -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(); -- 2.7.4