| 32 | |
| 33 | template <class F> |
| 34 | migraphx::module_ref create_pointwise_module(migraphx::program& p, |
| 35 | const std::string& name, |
| 36 | std::vector<migraphx::instruction_ref> inputs, |
| 37 | const F& f) |
| 38 | { |
| 39 | auto* pm = p.create_module(name); |
| 40 | pm->set_bypass(); |
| 41 | std::vector<migraphx::instruction_ref> params; |
| 42 | std::transform(inputs.begin(), inputs.end(), std::back_inserter(params), [&](auto input) { |
| 43 | return pm->add_parameter("x" + std::to_string(params.size()), |
| 44 | migraphx::shape{input->get_shape().type()}); |
| 45 | }); |
| 46 | auto r = f(pm, params); |
| 47 | pm->add_return({r}); |
| 48 | return pm; |
| 49 | } |
| 50 | |
| 51 | template <class F> |
| 52 | migraphx::instruction_ref add_pointwise(migraphx::program& p, |
no test coverage detected