未验证 提交 08186f14 编写于 作者: Z Zhang Zheng 提交者: GitHub

Correct spelling errors (#46108)

上级 268f097e
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace phi { namespace phi {
template <typename InT, typename OutT> template <typename InT, typename OutT>
struct CastFuctor { struct CastFunctor {
__device__ __forceinline__ OutT operator()(const InT x) const { __device__ __forceinline__ OutT operator()(const InT x) const {
return static_cast<OutT>(x); return static_cast<OutT>(x);
} }
...@@ -36,7 +36,7 @@ void CastCUDAKernelImpl(const GPUContext& dev_ctx, ...@@ -36,7 +36,7 @@ void CastCUDAKernelImpl(const GPUContext& dev_ctx,
outputs.emplace_back(out); outputs.emplace_back(out);
dev_ctx.Alloc<OutT>(out); dev_ctx.Alloc<OutT>(out);
phi::funcs::ElementwiseKernel<OutT>( phi::funcs::ElementwiseKernel<OutT>(
dev_ctx, inputs, &outputs, CastFuctor<InT, OutT>()); dev_ctx, inputs, &outputs, CastFunctor<InT, OutT>());
} }
} // namespace phi } // namespace phi
...@@ -20,11 +20,11 @@ limitations under the License. */ ...@@ -20,11 +20,11 @@ limitations under the License. */
namespace phi { namespace phi {
template <typename InT, typename OutT = InT> template <typename InT, typename OutT = InT>
struct FullFuctor { struct FullFunctor {
OutT value; OutT value;
template <typename VType> template <typename VType>
explicit inline FullFuctor(VType val) { explicit inline FullFunctor(VType val) {
value = static_cast<OutT>(val); value = static_cast<OutT>(val);
} }
...@@ -50,7 +50,7 @@ void FullKernel(const Context& dev_ctx, ...@@ -50,7 +50,7 @@ void FullKernel(const Context& dev_ctx,
// the data will not be loaded in the kernel because the number of // the data will not be loaded in the kernel because the number of
// parameters in the operator is 0 // parameters in the operator is 0
phi::funcs::ElementwiseKernel<T>( phi::funcs::ElementwiseKernel<T>(
dev_ctx, inputs, &outputs, FullFuctor<T>(val.to<T>())); dev_ctx, inputs, &outputs, FullFunctor<T>(val.to<T>()));
} }
} }
...@@ -104,7 +104,7 @@ void FullLikeKernel(const Context& dev_ctx, ...@@ -104,7 +104,7 @@ void FullLikeKernel(const Context& dev_ctx,
int numel = out->numel(); int numel = out->numel();
if (numel > 0) { if (numel > 0) {
phi::funcs::ElementwiseKernel<T>( phi::funcs::ElementwiseKernel<T>(
dev_ctx, inputs, &outputs, FullFuctor<T>(value)); dev_ctx, inputs, &outputs, FullFunctor<T>(value));
} }
} }
......
...@@ -23,11 +23,11 @@ limitations under the License. */ ...@@ -23,11 +23,11 @@ limitations under the License. */
namespace phi { namespace phi {
template <typename InT, typename OutT = InT> template <typename InT, typename OutT = InT>
struct FullFuctor { struct FullFunctor {
OutT value; OutT value;
template <typename VType> template <typename VType>
explicit inline FullFuctor(VType val) { explicit inline FullFunctor(VType val) {
value = static_cast<OutT>(val); value = static_cast<OutT>(val);
} }
...@@ -54,7 +54,7 @@ void CooFullLikeKernel(const Context& dev_ctx, ...@@ -54,7 +54,7 @@ void CooFullLikeKernel(const Context& dev_ctx,
int numel = values->numel(); int numel = values->numel();
if (numel > 0) { if (numel > 0) {
phi::funcs::ElementwiseKernel<T>( phi::funcs::ElementwiseKernel<T>(
dev_ctx, inputs, &outputs, FullFuctor<T>(val.to<T>())); dev_ctx, inputs, &outputs, FullFunctor<T>(val.to<T>()));
} }
out->set_dims(x.dims()); out->set_dims(x.dims());
} }
...@@ -80,7 +80,7 @@ void CsrFullLikeKernel(const Context& dev_ctx, ...@@ -80,7 +80,7 @@ void CsrFullLikeKernel(const Context& dev_ctx,
int numel = values->numel(); int numel = values->numel();
if (numel > 0) { if (numel > 0) {
phi::funcs::ElementwiseKernel<T>( phi::funcs::ElementwiseKernel<T>(
dev_ctx, inputs, &outputs, FullFuctor<T>(val.to<T>())); dev_ctx, inputs, &outputs, FullFunctor<T>(val.to<T>()));
} }
out->set_dims(x.dims()); out->set_dims(x.dims());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册