MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / parse

Method parse

src/onnx/parse_split.cpp:166–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 std::vector<op_desc> operators() const { return {{"Split"}}; }
165
166 std::vector<instruction_ref> parse(const op_desc& opd,
167 const onnx_parser& parser,
168 onnx_parser::node_info info,
169 std::vector<instruction_ref> args) const
170 {
171 int64_t axis = 0;
172 if(contains(info.attributes, "axis"))
173 {
174 axis = parser.parse_value(info.attributes.at("axis")).at<int>();
175 }
176
177 const auto& input_shape = args[0]->get_shape();
178 // axis over which the split occurs (split_axis)
179 int64_t tuned_axis = tune_axis(input_shape.ndim(), axis, opd.onnx_name);
180
181 auto split_axis_is_fixed = [&]() {
182 return input_shape.dyn_dims().at(tuned_axis).is_fixed();
183 };
184
185 if(input_shape.dynamic() and not split_axis_is_fixed())
186 {
187 return parse_dyn_split(info, args, tuned_axis);
188 }
189 else
190 {
191 return parse_static_split(info, parser, args, tuned_axis);
192 }
193 }
194};
195
196} // namespace onnx

Callers

nothing calls this directly

Calls 10

containsFunction · 0.85
tune_axisFunction · 0.85
parse_dyn_splitFunction · 0.85
parse_static_splitFunction · 0.85
parse_valueMethod · 0.80
atMethod · 0.80
ndimMethod · 0.80
is_fixedMethod · 0.80
dynamicMethod · 0.80
get_shapeMethod · 0.45

Tested by

no test coverage detected