| 36 | std::vector<op_desc> operators() const { return {{"Reshape"}}; } |
| 37 | |
| 38 | instruction_ref parse(const op_desc& /*opd*/, |
| 39 | const tf_parser& /*parser*/, |
| 40 | const tf_parser::node_info& info, |
| 41 | std::vector<instruction_ref> args) const |
| 42 | { |
| 43 | if(args.size() != 2) |
| 44 | MIGRAPHX_THROW("reshape needs 2 arguments (input, new_shape)"); |
| 45 | auto s = args[1]->eval(); |
| 46 | std::vector<int64_t> dims; |
| 47 | s.visit([&](auto v) { copy(v, std::back_inserter(dims)); }); |
| 48 | return info.add_instruction(make_op("reshape", {{"dims", dims}}), args[0]); |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | } // namespace tf |