| 1571 | } |
| 1572 | |
| 1573 | cg::OperatorNodeBase::OprEventCallback Reduce::get_opr_event_callback() { |
| 1574 | auto on_mem_status_changed = [this]() { |
| 1575 | auto&& ishp = input(0)->shape(); |
| 1576 | auto&& oshp = output(0)->shape(); |
| 1577 | OutTensorShapeExtender extender(ishp, oshp); |
| 1578 | auto&& canonized_oshp = extender.get(); |
| 1579 | m_kern_scheduler->check_shapes(input(0)->shape(), canonized_oshp); |
| 1580 | m_kern_scheduler->update_ptr( |
| 1581 | input(0)->dev_tensor(), output(0)->dev_tensor(), |
| 1582 | output(1)->shape()[0] ? output(1)->dev_tensor() : DeviceTensorND{}); |
| 1583 | }; |
| 1584 | return {on_mem_status_changed}; |
| 1585 | } |
| 1586 | |
| 1587 | void Reduce::mem_plan_fwd_in2out_readonly() { |
| 1588 | init_kern_sched_shape(input(0)->shape(), output(0)->shape()); |
nothing calls this directly
no test coverage detected