Skip to content

Commit

Permalink
Fix build error for CoreML Split op (microsoft#19099)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->
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
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix build error

---------

Co-authored-by: Edward Chen <[email protected]>
  • Loading branch information
skottmckay and edgchen1 authored Jan 15, 2024
1 parent 71657d1 commit b2ce3ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>();
int sum_of_splits = std::accumulate(splits_span.begin(), splits_span.end(), 0);
auto splits_span = unpacked_tensor.DataAsSpan<int64_t>();
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
Expand Down

0 comments on commit b2ce3ee

Please sign in to comment.