diff --git a/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc b/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc index f15618f821..3ccf242bab 100644 --- a/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc +++ b/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc @@ -6,6 +6,7 @@ #include "core/providers/coreml/builders/impl/builder_utils.h" #include "core/providers/coreml/builders/model_builder.h" #endif +#include "core/common/narrow.h" #include "core/providers/common.h" #include "core/providers/coreml/builders/helper.h" #include "core/providers/coreml/builders/impl/base_op_builder.h" @@ -51,7 +52,7 @@ Status AddPReluWeight(ModelBuilder& model_builder, const Node& node, COREML_SPEC::ActivationPReLU& prelu) { // add slope initializer as alpha weight const auto& slope_tensor = *model_builder.GetInitializerTensors().at(node.InputDefs()[1]->Name()); - const auto slope_tensor_num_elements = gsl::narrow(Product(slope_tensor.dims())); + const auto slope_tensor_num_elements = narrow(Product(slope_tensor.dims())); if (slope_tensor_num_elements != 1) { ORT_RETURN_IF_ERROR(CreateCoreMLWeight(*prelu.mutable_alpha(), slope_tensor)); } else {