| 424 | } |
| 425 | |
| 426 | inline 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 | |
| 438 | inline bool if_convert_format(const Format src_fmt, const FT& dst_fmt) { |
| 439 | if ((src_fmt == FT::NCHW && dst_fmt == FT::DEFAULT) || |
no test coverage detected