| 39 | } |
| 40 | |
| 41 | SmallVector<TensorPtr> apply_on_physical_tensor( |
| 42 | const OpDef& def, const SmallVector<TensorPtr>& inputs, |
| 43 | SmallVector<LogicalTensorDesc>& output_descs, const bool& validated) { |
| 44 | auto&& op = def.cast_final_safe<Flip>(); |
| 45 | auto cn = inputs[0]->comp_node(); |
| 46 | |
| 47 | DnnOprCaller<megdnn::Flip> dnn_opr(cn, op.param()); |
| 48 | auto&& out_layout = [&]() -> TensorLayout { |
| 49 | if (validated) { |
| 50 | return output_descs[0].layout; |
| 51 | } else { |
| 52 | return dnn_opr.deduce_layout(inputs[0]->layout()); |
| 53 | } |
| 54 | }(); |
| 55 | |
| 56 | auto out = Tensor::make(out_layout, cn); |
| 57 | |
| 58 | dnn_opr.exec_with_ws(inputs[0], out); |
| 59 | return {out}; |
| 60 | } |
| 61 | |
| 62 | SmallVector<VarNode::LayoutConstraintCallback> get_input_layout_constraint( |
| 63 | const OpDef& def, const SmallVector<TensorPtr>& inputs) { |
nothing calls this directly
no test coverage detected