Skip to content

Commit

Permalink
Replace gsl::narrow with narrow in WebNN code (#22733)
Browse files Browse the repository at this point in the history
Replace use of `gsl::narrow` with `narrow` to build for WebNN @snnn 

### Description

Building for WebNN with exceptions disabled cannot use `gsl::narrow`.
Replace with `narrow`

### Motivation and Context

Address issue #22712
  • Loading branch information
sevagh authored Nov 5, 2024
1 parent db72096 commit 00461d1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Status SplitOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder,
// Check that the splits evenly divide.
if (split_count > 0 && splits.empty() && input_shape[axis] % split_count != 0) {
// Divide inputs into variable size outputs:
splits.insert(splits.end(), split_count - 1, gsl::narrow<uint32_t>(input_shape[axis]) / split_count);
splits.insert(splits.end(), gsl::narrow<uint32_t>(input_shape[axis]) % split_count);
splits.insert(splits.end(), split_count - 1, narrow<uint32_t>(input_shape[axis]) / split_count);
splits.insert(splits.end(), narrow<uint32_t>(input_shape[axis]) % split_count);
}

if (splits.empty()) {
Expand Down

0 comments on commit 00461d1

Please sign in to comment.