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

Function batchnorm_rule

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

Source from the content-addressed store, hash-verified

523}
524
525ValueRefList batchnorm_rule(
526 const BatchNorm& op, Span<ValueRef>& inputs, const bool& auto_convert,
527 const FormatTransformation& t) {
528 auto&& inp_format = inputs[0].cast(t.value_type()).format();
529 if (inp_format == FT::NHWC) {
530 auto new_param = op.param();
531 new_param.param_dim = BatchNorm::ParamDim::DIM_111C;
532 auto new_op = BatchNorm::make(new_param);
533 return identity_rule_helper(*new_op, inputs, t);
534 }
535 return identity_rule_helper(op, inputs, t);
536}
537
538ValueRefList adaptive_pooling_rule(
539 const AdaptivePooling& op, Span<ValueRef>& inputs, const bool& auto_convert,

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