From a53ed850bd74e4ebf5be3f2c1fc66ea62de70401 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Thu, 18 Mar 2021 15:43:45 -0700 Subject: [PATCH] Fix signature of unboxed aten::arange for torch HEAD --- frontends/pytorch/csrc/builder/acap_dispatch.cpp | 4 ++-- frontends/pytorch/csrc/builder/acap_dispatch.h | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontends/pytorch/csrc/builder/acap_dispatch.cpp b/frontends/pytorch/csrc/builder/acap_dispatch.cpp index ed8fb4485..c3b07624d 100644 --- a/frontends/pytorch/csrc/builder/acap_dispatch.cpp +++ b/frontends/pytorch/csrc/builder/acap_dispatch.cpp @@ -364,7 +364,7 @@ at::Tensor &AcapController::copyUnderKernel(at::Tensor &self, } at::Tensor AcapController::arangeBackendSelectKernel( - at::Scalar end, c10::optional dtype, + const at::Scalar &end, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { static c10::OperatorName opName{"aten::arange", ""}; @@ -380,7 +380,7 @@ at::Tensor AcapController::arangeBackendSelectKernel( // built-in handlers dispatch to BackendSelect kernels. auto targetDk = c10::computeDispatchKey(dtype, layout, device); auto opTyped = opHandle->typed dtype, + const at::Scalar &end, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory)>(); return opTyped.redispatch(c10::DispatchKeySet({targetDk}), end, dtype, layout, device, diff --git a/frontends/pytorch/csrc/builder/acap_dispatch.h b/frontends/pytorch/csrc/builder/acap_dispatch.h index 37d4a261d..954557bd8 100644 --- a/frontends/pytorch/csrc/builder/acap_dispatch.h +++ b/frontends/pytorch/csrc/builder/acap_dispatch.h @@ -72,11 +72,10 @@ public: bool non_blocking); // Backend select kernel for arange factory function. - static at::Tensor - arangeBackendSelectKernel(at::Scalar end, c10::optional dtype, - c10::optional layout, - c10::optional device, - c10::optional pin_memory); + static at::Tensor arangeBackendSelectKernel( + const at::Scalar &end, c10::optional dtype, + c10::optional layout, c10::optional device, + c10::optional pin_memory); private: /// Builds a kernel call step by step.