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

Function identity_rule_helper

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

Source from the content-addressed store, hash-verified

512}
513
514ValueRefList identity_rule_helper(
515 const OpDef& op, const Span<ValueRef>& inputs, const FormatTransformation& t) {
516 // mgb_assert(inputs.size() == 1);
517 if (auto& src = inputs[0].as_ref(t.value_type())) {
518 return t.wrap_outputs(
519 imperative::apply(op, t.unwrap_inputs(inputs)), src->format());
520 } else {
521 return t.wrap_outputs(imperative::apply(op, t.unwrap_inputs(inputs)));
522 }
523}
524
525ValueRefList batchnorm_rule(
526 const BatchNorm& op, Span<ValueRef>& inputs, const bool& auto_convert,

Callers 3

batchnorm_ruleFunction · 0.85
adaptive_pooling_ruleFunction · 0.85
conv_bwd_data_ruleFunction · 0.85

Calls 5

as_refMethod · 0.80
wrap_outputsMethod · 0.80
unwrap_inputsMethod · 0.80
applyFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected