From 1053b1d5ed04f411db50e66848210d9f1996bde4 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Sat, 15 Jan 2022 14:52:58 +0800 Subject: [PATCH] replace last contextT (#38971) --- paddle/pten/kernels/gpu/scale_kernel.cu | 4 ++-- paddle/pten/kernels/math_kernel.h | 24 ++++++++++++------------ paddle/pten/kernels/scale_kernel.h | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/paddle/pten/kernels/gpu/scale_kernel.cu b/paddle/pten/kernels/gpu/scale_kernel.cu index 4d63701413c..14ee75e4f91 100644 --- a/paddle/pten/kernels/gpu/scale_kernel.cu +++ b/paddle/pten/kernels/gpu/scale_kernel.cu @@ -43,8 +43,8 @@ struct ScaleFunctor { } }; -template -void ScaleKernel(const ContextT& dev_ctx, +template +void ScaleKernel(const Context& dev_ctx, const DenseTensor& x, const Scalar& scale, float bias, diff --git a/paddle/pten/kernels/math_kernel.h b/paddle/pten/kernels/math_kernel.h index e01103fc5b8..65c0f84e696 100644 --- a/paddle/pten/kernels/math_kernel.h +++ b/paddle/pten/kernels/math_kernel.h @@ -67,8 +67,8 @@ void SumKernel(const Context& dev_ctx, DataType out_dtype, DenseTensor* out); -template -DenseTensor Add(const ContextT& dev_ctx, +template +DenseTensor Add(const Context& dev_ctx, const DenseTensor& x, const DenseTensor& y, int axis) { @@ -77,12 +77,12 @@ DenseTensor Add(const ContextT& dev_ctx, pten::make_intrusive( dev_ctx.GetPlace()), std::move(out_meta)); - AddKernel(dev_ctx, x, y, axis, &dense_out); + AddKernel(dev_ctx, x, y, axis, &dense_out); return dense_out; } -template -DenseTensor Subtract(const ContextT& dev_ctx, +template +DenseTensor Subtract(const Context& dev_ctx, const DenseTensor& x, const DenseTensor& y, int axis) { @@ -91,12 +91,12 @@ DenseTensor Subtract(const ContextT& dev_ctx, pten::make_intrusive( dev_ctx.GetPlace()), std::move(out_meta)); - SubtractKernel(dev_ctx, x, y, axis, &dense_out); + SubtractKernel(dev_ctx, x, y, axis, &dense_out); return dense_out; } -template -DenseTensor Divide(const ContextT& dev_ctx, +template +DenseTensor Divide(const Context& dev_ctx, const DenseTensor& x, const DenseTensor& y, int axis) { @@ -105,12 +105,12 @@ DenseTensor Divide(const ContextT& dev_ctx, pten::make_intrusive( dev_ctx.GetPlace()), std::move(out_meta)); - DivideKernel(dev_ctx, x, y, axis, &dense_out); + DivideKernel(dev_ctx, x, y, axis, &dense_out); return dense_out; } -template -DenseTensor Multiply(const ContextT& dev_ctx, +template +DenseTensor Multiply(const Context& dev_ctx, const DenseTensor& x, const DenseTensor& y, int axis) { @@ -119,7 +119,7 @@ DenseTensor Multiply(const ContextT& dev_ctx, pten::make_intrusive( dev_ctx.GetPlace()), std::move(out_meta)); - MultiplyKernel(dev_ctx, x, y, axis, &dense_out); + MultiplyKernel(dev_ctx, x, y, axis, &dense_out); return dense_out; } diff --git a/paddle/pten/kernels/scale_kernel.h b/paddle/pten/kernels/scale_kernel.h index ba16db566b8..1cd11f0b878 100644 --- a/paddle/pten/kernels/scale_kernel.h +++ b/paddle/pten/kernels/scale_kernel.h @@ -28,15 +28,15 @@ void ScaleKernel(const Context& dev_ctx, bool bias_after_scale, DenseTensor* out); -template -DenseTensor Scale(const ContextT& dev_ctx, +template +DenseTensor Scale(const Context& dev_ctx, const DenseTensor& x, const Scalar& scale, float bias, bool bias_after_scale) { auto out_meta = UnchangedInferMeta(x.meta()); - auto dense_out = pten::Empty(dev_ctx, std::move(out_meta)); - ScaleKernel( + auto dense_out = pten::Empty(dev_ctx, std::move(out_meta)); + ScaleKernel( dev_ctx, x, scale, bias, bias_after_scale, &dense_out); return dense_out; } -- GitLab