From 0240274dfd8fbf70b458c65237f9615dcb5052a9 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 1 Nov 2023 10:33:52 -0700 Subject: [PATCH] Add support for GCC 13 (#18178) It is related to #18155 . The issue has been fixed in the main branch by @jchen351 --- onnxruntime/core/providers/cpu/tensor/scatter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cpu/tensor/scatter.cc b/onnxruntime/core/providers/cpu/tensor/scatter.cc index f87788e8f4..8844b7e7a2 100644 --- a/onnxruntime/core/providers/cpu/tensor/scatter.cc +++ b/onnxruntime/core/providers/cpu/tensor/scatter.cc @@ -308,7 +308,7 @@ Status ScatterData( const auto& upd_shape = updates_input->Shape(); const auto num_dims = input_data_shape.NumDimensions(); - assert(num_dims > 0); + ORT_RETURN_IF_NOT(num_dims > 0, "ScatterElements op: input tensor must have at least one dimension"); // Allocate and zero out counts. The input/output is of the same rank as // indices/updates but the actual dimensions of indices/updates must be less or equal