| 41 | static void run_pass(migraphx::module& m) { run_passes(m, {migraphx::simplify_algebra{}}); } |
| 42 | |
| 43 | static migraphx::instruction_ref add_quantize_op(migraphx::module& m, |
| 44 | const std::string& name, |
| 45 | migraphx::instruction_ref x, |
| 46 | migraphx::instruction_ref scale, |
| 47 | migraphx::instruction_ref shift) |
| 48 | { |
| 49 | auto lens = x->get_shape().lens(); |
| 50 | auto scale_mb = |
| 51 | m.add_instruction(migraphx::make_op("multibroadcast", {{"out_lens", lens}}), scale); |
| 52 | auto shift_mb = |
| 53 | m.add_instruction(migraphx::make_op("multibroadcast", {{"out_lens", lens}}), shift); |
| 54 | return m.add_instruction(migraphx::make_op(name), x, scale_mb, shift_mb); |
| 55 | } |
| 56 | |
| 57 | static migraphx::instruction_ref |
| 58 | add_quantize_op(migraphx::module& m, |