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

Function register_format_rule

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

Source from the content-addressed store, hash-verified

155
156template <typename T>
157void register_format_rule(ValueRefList (*rule)(
158 const T&, Span<ValueRef>&, const bool&, const FormatTransformation&)) {
159 format_rules[T::typeinfo()] = [rule](const OpDef& def, Span<ValueRef>& inputs,
160 const bool& auto_convert,
161 const FormatTransformation& t) {
162 return (*rule)(def.cast_final_safe<T>(), inputs, auto_convert, t);
163 };
164}
165
166inline auto convert_nchw2nhwc_pattern(const std::vector<int32_t>& pattern) {
167 mgb_assert(pattern.size() == 4);

Callers 1

FormatRuleRegistryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected