Fix bug in ReduceSum with noop_with_empty_axes (#9301)

This commit is contained in:
TomWildenhain-Microsoft 2021-10-08 13:33:24 -07:00 committed by GitHub
parent 7b61bca6df
commit da56f01ac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -657,8 +657,8 @@ bool CommonFastReduceCopy(OpKernelContext* ctx, std::vector<int64_t>& input_axes
if (input_axes.empty() && noop_with_empty_axes) {
const Tensor* input = ctx->Input<Tensor>(0);
auto* output = ctx->Output(0, input->Shape());
memcpy(reinterpret_cast<void*>(output->template MutableData<float>()),
reinterpret_cast<const void*>(input->template Data<float>()),
memcpy(output->MutableDataRaw(),
input->DataRaw(),
input->SizeInBytes());
return true;
}