| 26 | } |
| 27 | |
| 28 | std::tuple<SmallVector<LogicalTensorDesc>, bool> infer_output_attrs_fallible( |
| 29 | const OpDef& def, const SmallVector<LogicalTensorDesc>& inputs) { |
| 30 | auto&& conv = def.cast_final_safe<Convolution>(); |
| 31 | DnnOprHelper<megdnn::ConvolutionForward> dnn_opr(conv.param()); |
| 32 | auto&& data = inputs[0].layout; |
| 33 | auto&& filter = inputs[1].layout; |
| 34 | TensorLayout output_layout{data.dtype}; |
| 35 | if (data.ndim && filter.ndim) { |
| 36 | // deduce_layout won't override existing dtype |
| 37 | dnn_opr.opr().deduce_layout(data, filter, output_layout); |
| 38 | } |
| 39 | return {{{output_layout, inputs[0].comp_node}}, output_layout.ndim != 0}; |
| 40 | } |
| 41 | |
| 42 | // Convolution::Param -> ConvBias::Param |
| 43 | auto conv_bias_param_from_convolution(const Convolution& conv) { |
nothing calls this directly
no test coverage detected