Split of what we handle since this parser is used for both resize/upscale operators
| 605 | |
| 606 | // Split of what we handle since this parser is used for both resize/upscale operators |
| 607 | static resize_args handle_inputs(const op_desc& opd, |
| 608 | const onnx_parser::node_info& info, |
| 609 | const std::vector<instruction_ref>& args) |
| 610 | { |
| 611 | resize_args resize; |
| 612 | |
| 613 | // input data shape info |
| 614 | resize.in_s = args[0]->get_shape().to_static(1); |
| 615 | resize.in_lens = resize.in_s.lens(); |
| 616 | |
| 617 | // output shape is explicitly specified |
| 618 | resize.out_lens = std::vector<size_t>(resize.in_lens.size()); |
| 619 | |
| 620 | if(opd.op_name == "upsample") |
| 621 | { |
| 622 | set_upsample_attributes(info, resize); |
| 623 | set_upsample_args(args, resize); |
| 624 | } |
| 625 | else |
| 626 | { |
| 627 | set_resize_attributes(info, args, resize); |
| 628 | set_resize_args(args, resize); |
| 629 | } |
| 630 | |
| 631 | return resize; |
| 632 | } |
| 633 | |
| 634 | instruction_ref parse(const op_desc& opd, |
| 635 | const onnx_parser&, |