From da56f01ac20ac7e1793a3847ec6c8d3111b5e7a6 Mon Sep 17 00:00:00 2001 From: TomWildenhain-Microsoft <67606533+TomWildenhain-Microsoft@users.noreply.github.com> Date: Fri, 8 Oct 2021 13:33:24 -0700 Subject: [PATCH] Fix bug in ReduceSum with noop_with_empty_axes (#9301) --- onnxruntime/core/providers/cpu/reduction/reduction_ops.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/cpu/reduction/reduction_ops.cc b/onnxruntime/core/providers/cpu/reduction/reduction_ops.cc index d8426c3f78..e8e689508f 100644 --- a/onnxruntime/core/providers/cpu/reduction/reduction_ops.cc +++ b/onnxruntime/core/providers/cpu/reduction/reduction_ops.cc @@ -657,8 +657,8 @@ bool CommonFastReduceCopy(OpKernelContext* ctx, std::vector& input_axes if (input_axes.empty() && noop_with_empty_axes) { const Tensor* input = ctx->Input(0); auto* output = ctx->Output(0, input->Shape()); - memcpy(reinterpret_cast(output->template MutableData()), - reinterpret_cast(input->template Data()), + memcpy(output->MutableDataRaw(), + input->DataRaw(), input->SizeInBytes()); return true; }