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

Function get_inputs_format

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

Source from the content-addressed store, hash-verified

424}
425
426inline FT get_inputs_format(Span<ValueRef>& inputs, const FormatTransformation& t) {
427 FT format(FT::DEFAULT);
428 for (auto& inp : inputs) {
429 auto&& inp_format = inp.cast(t.value_type()).format();
430 if (inp_format != FT::DEFAULT) {
431 mgb_assert(format == FT::DEFAULT || inp_format == format);
432 format = inp_format.type();
433 }
434 }
435 return format;
436}
437
438inline bool if_convert_format(const Format src_fmt, const FT& dst_fmt) {
439 if ((src_fmt == FT::NCHW && dst_fmt == FT::DEFAULT) ||

Callers 2

elemwise_ruleFunction · 0.85
concat_ruleFunction · 0.85

Calls 3

formatMethod · 0.45
castMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected