From 00461d12051bce30f4060c6c4f25ffe3c0f65f4b Mon Sep 17 00:00:00 2001 From: Sevag H Date: Tue, 5 Nov 2024 13:22:34 -0500 Subject: [PATCH] Replace gsl::narrow with narrow in WebNN code (#22733) 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 --- .../core/providers/webnn/builders/impl/split_op_builder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/webnn/builders/impl/split_op_builder.cc b/onnxruntime/core/providers/webnn/builders/impl/split_op_builder.cc index 4c59b694d690a..c4ccc80d44c0f 100644 --- a/onnxruntime/core/providers/webnn/builders/impl/split_op_builder.cc +++ b/onnxruntime/core/providers/webnn/builders/impl/split_op_builder.cc @@ -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(input_shape[axis]) / split_count); - splits.insert(splits.end(), gsl::narrow(input_shape[axis]) % split_count); + splits.insert(splits.end(), split_count - 1, narrow(input_shape[axis]) / split_count); + splits.insert(splits.end(), narrow(input_shape[axis]) % split_count); } if (splits.empty()) {