| 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 |
nothing calls this directly
no test coverage detected