You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: onnxruntime/core/providers/cpu/math/einsum_utils/einsum_typed_compute_processor.cc
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -368,12 +368,12 @@ Status EinsumTypedComputeProcessor<T>::Run() {
368
368
369
369
{
370
370
TensorShapeVector reduced_dims; // All dims of the input that are reduced using the `ReduceSum` op
371
-
reduced_dims.reserve(onnxruntime::narrow<size_t>(num_subscript_labels)); // num_subscript_labels is the upper bound. No harm in over-reserving
371
+
reduced_dims.reserve(num_subscript_labels); // num_subscript_labels is the upper bound. No harm in over-reserving
372
372
373
373
TensorShapeVector all_dims; // All dimension indices from 0 to num_subscript_labels - 1
374
-
all_dims.reserve(onnxruntime::narrow<size_t>(num_subscript_labels)); // num_subscript_labels is the number of elements
374
+
all_dims.reserve(num_subscript_labels); // num_subscript_labels is the number of elements
375
375
376
-
for (size_t i = 0; i < onnxruntime::narrow<size_t>(num_subscript_labels); ++i) {
376
+
for (size_t i = 0; i < num_subscript_labels; ++i) {
377
377
if (mapped_indices_to_last_input_index[i] == 0) {
378
378
reduced_dims.push_back(i);
379
379
}
@@ -411,9 +411,9 @@ Status EinsumTypedComputeProcessor<T>::Run() {
411
411
// Keep processing each input pair-wise
412
412
for (int input = 1; input < num_inputs; ++input) {
413
413
TensorShapeVector reduced_dims;
414
-
reduced_dims.reserve(onnxruntime::narrow<size_t>(num_subscript_labels)); // num_subscript_labels is the upper bound. No harm in over-reserving by a small margin.
415
-
for (int64_t dim = 0; dim < num_subscript_labels; ++dim) {
416
-
if (mapped_indices_to_last_input_index[onnxruntime::narrow<size_t>(dim)] == input) {
414
+
reduced_dims.reserve(num_subscript_labels); // num_subscript_labels is the upper bound. No harm in over-reserving by a small margin.
415
+
for (size_t dim = 0; dim < num_subscript_labels; ++dim) {
416
+
if (mapped_indices_to_last_input_index[dim] == input) {
417
417
// This is the last input we are seeing this dimension (and it doesn't occur in the output), so reduce along the dimension
0 commit comments