From 6c029c80f70c777a1683809cd11c082079786c92 Mon Sep 17 00:00:00 2001 From: "Gao, Xiang" Date: Sun, 24 Mar 2019 19:24:08 -0700 Subject: [PATCH] Fix deprecated: type() -> scalar_type() Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18394 Differential Revision: D14593890 Pulled By: soumith fbshipit-source-id: 92b9a8c22008341c0cc3b7a721bef1973c528daf --- aten/src/ATen/native/cpu/DistanceOpsKernel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aten/src/ATen/native/cpu/DistanceOpsKernel.cpp b/aten/src/ATen/native/cpu/DistanceOpsKernel.cpp index 0a16a82..688866f 100644 --- a/aten/src/ATen/native/cpu/DistanceOpsKernel.cpp +++ b/aten/src/ATen/native/cpu/DistanceOpsKernel.cpp @@ -336,25 +336,25 @@ struct Dist { }; void pdist_forward_kernel_impl(Tensor& result, const Tensor& self, const double p) { - AT_DISPATCH_FLOATING_TYPES(self.type(), "pdist", [&] { + AT_DISPATCH_FLOATING_TYPES(self.scalar_type(), "pdist", [&] { Dist::apply_pdist(result, self, p); }); } static void pdist_backward_kernel_impl(Tensor& result, const Tensor& grad, const Tensor& self, const double p, const Tensor& dist) { - AT_DISPATCH_FLOATING_TYPES(self.type(), "pdist_backward", [&] { + AT_DISPATCH_FLOATING_TYPES(self.scalar_type(), "pdist_backward", [&] { Dist::apply_backward_pdist(result, grad, self, p, dist); }); } static void cdist_kernel_impl(Tensor& result, const Tensor& x1, const Tensor& x2, const double p) { - AT_DISPATCH_FLOATING_TYPES(result.type(), "cdist", [&] { + AT_DISPATCH_FLOATING_TYPES(result.scalar_type(), "cdist", [&] { Dist::apply_cdist(result, x1, x2, p); }); } static void cdist_backward_kernel_impl(Tensor& result, const Tensor& grad, const Tensor& x1, const Tensor& x2, const double p, const Tensor& dist) { - AT_DISPATCH_FLOATING_TYPES(result.type(), "cdist_backward", [&] { + AT_DISPATCH_FLOATING_TYPES(result.scalar_type(), "cdist_backward", [&] { Dist::apply_backward_cdist(result, grad, x1, x2, p, dist); }); } -- 2.7.4