MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / adaptive_pooling_rule

Function adaptive_pooling_rule

imperative/src/impl/transformations/format.cpp:538–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538ValueRefList adaptive_pooling_rule(
539 const AdaptivePooling& op, Span<ValueRef>& inputs, const bool& auto_convert,
540 const FormatTransformation& t) {
541 auto&& inp_format = inputs[0].cast(t.value_type()).format();
542 if (inp_format == FT::NHWC) {
543 auto new_param = op.param();
544 new_param.format = AdaptivePooling::Format::NHWC;
545 auto new_op = AdaptivePooling::make(new_param, op.shape);
546 return identity_rule_helper(*new_op, inputs, t);
547 }
548 return identity_rule_helper(op, inputs, t);
549}
550
551ValueRefList conv_bwd_data_rule(
552 const ConvolutionBackwardData& op, Span<ValueRef>& inputs,

Callers

nothing calls this directly

Calls 5

identity_rule_helperFunction · 0.85
makeFunction · 0.50
formatMethod · 0.45
castMethod · 0.45
paramMethod · 0.45

Tested by

no test coverage detected