@@ -37,11 +37,11 @@ Status SplitOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder,
37
37
emscripten::val output_array;
38
38
std::vector<int64_t > input_shape;
39
39
ORT_RETURN_IF_NOT (GetShape (*input_defs[0 ], input_shape, logger), " Cannot get shape" );
40
- const auto rank = input_shape.size ();
40
+ const size_t rank = input_shape.size ();
41
41
emscripten::val options = emscripten::val::object ();
42
42
43
43
NodeAttrHelper helper (node);
44
- auto axis = helper.Get (" axis" , 0 );
44
+ int32_t axis = helper.Get (" axis" , 0 );
45
45
axis = SafeInt<int32_t >(HandleNegativeAxis (axis, rank));
46
46
options.set (" axis" , axis);
47
47
@@ -59,13 +59,13 @@ Status SplitOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder,
59
59
" The size of outputs must be equal to the size of 'split' input." );
60
60
} else {
61
61
if (helper.HasAttr (" num_outputs" )) {
62
- const auto num_outputs = helper.Get (" num_outputs" , 1 );
62
+ const int32_t num_outputs = helper.Get (" num_outputs" , 1 );
63
63
ORT_RETURN_IF_NOT (num_outputs > 0 , " The 'num_outputs' must be a positive integer." );
64
64
if (input_shape[axis] % num_outputs == 0 ) {
65
65
// The 'num_outputs' evenly divide the dim value at 'axis' specified.
66
66
output_array = model_builder.GetBuilder ().call <emscripten::val>(" split" ,
67
67
input,
68
- static_cast < int32_t >( num_outputs) ,
68
+ num_outputs,
69
69
options);
70
70
} else {
71
71
std::vector<int64_t > mapping_split;
@@ -80,22 +80,22 @@ Status SplitOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder,
80
80
emscripten::val::array (converted_splits),
81
81
options);
82
82
}
83
- ORT_RETURN_IF_NOT (output_array[" length" ].as <int32_t >() == static_cast < int32_t >( num_outputs) ,
83
+ ORT_RETURN_IF_NOT (output_array[" length" ].as <int32_t >() == num_outputs,
84
84
" The size of outputs must be equal to 'num_outputs'." );
85
85
} else {
86
86
// w/o 'split' input for opset 13
87
87
// Refer to https://github.com/microsoft/onnxruntime/blob/a7ad859e3ab60bddfcf2fefa96bfcb550f0fc04c/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.cpp#L984-L989
88
88
// split input stream equally across output streams.
89
89
const auto & output_defs = node.OutputDefs ();
90
- auto output_count = output_defs.size ();
90
+ const size_t output_count = output_defs.size ();
91
91
output_array = model_builder.GetBuilder ().call <emscripten::val>(" split" ,
92
92
input, static_cast <int32_t >(output_count),
93
93
options);
94
- ORT_RETURN_IF_NOT (output_array[" length" ].as <int32_t >() == static_cast < int32_t >( output_count) ,
94
+ ORT_RETURN_IF_NOT (output_array[" length" ].as <size_t >() == output_count,
95
95
" The size of outputs must be equal to the count of output nodes." );
96
96
}
97
97
}
98
- for (size_t i = 0 , count = output_array[" length" ].as <int32_t >(); i < count; i++) {
98
+ for (size_t i = 0 , count = output_array[" length" ].as <size_t >(); i < count; i++) {
99
99
model_builder.AddOperand (node.OutputDefs ()[i]->Name (), std::move (output_array[i]));
100
100
}
101
101
return Status::OK ();
@@ -118,10 +118,10 @@ bool SplitOpBuilder::IsOpSupportedImpl(const InitializedTensorSet& initializers,
118
118
LOGS (logger, VERBOSE) << " Cannot get input's shape." ;
119
119
return false ;
120
120
}
121
- const auto rank = input_shape.size ();
121
+ const size_t rank = input_shape.size ();
122
122
123
123
NodeAttrHelper helper (node);
124
- auto axis = helper.Get (" axis" , 0 );
124
+ int32_t axis = helper.Get (" axis" , 0 );
125
125
axis = SafeInt<int32_t >(HandleNegativeAxis (axis, rank));
126
126
127
127
if (input_defs.size () == 2 ) {
0 commit comments