From b2ce3eedb9f3d9cee82525c9f29c2d1f42ba58c7 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Mon, 15 Jan 2024 15:09:49 +1000 Subject: [PATCH] Fix build error for CoreML Split op (#19099) ### Description The `split` input of the Split op is int64_t. Fixing that resolves a type mismatch build error on Windows when CoreML is enabled (for debugging the partitioning code). ### Motivation and Context Fix build error --------- Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com> --- .../core/providers/coreml/builders/impl/split_op_builder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/coreml/builders/impl/split_op_builder.cc b/onnxruntime/core/providers/coreml/builders/impl/split_op_builder.cc index 815f68128f..56c87c8831 100644 --- a/onnxruntime/core/providers/coreml/builders/impl/split_op_builder.cc +++ b/onnxruntime/core/providers/coreml/builders/impl/split_op_builder.cc @@ -139,8 +139,8 @@ bool SplitOpBuilder::IsOpSupportedImpl(const Node& node, const OpBuilderInputPar } const auto& splits_tensor = *initializers.at(input_defs[1]->Name()); Initializer unpacked_tensor(splits_tensor); - auto splits_span = unpacked_tensor.DataAsSpan(); - int sum_of_splits = std::accumulate(splits_span.begin(), splits_span.end(), 0); + auto splits_span = unpacked_tensor.DataAsSpan(); + int64_t sum_of_splits = std::accumulate(splits_span.begin(), splits_span.end(), int64_t{0}); if (sum_of_splits != split_dims_at_axis) { LOGS(logger, VERBOSE) << "Mismatch between the sum of 'split'. Expected: " << split_dims_at_axis