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

Function format_fixlayouts

src/rdnn/impl/algo_chooser.cpp:54–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53template <typename Opr>
54std::string format_fixlayouts(
55 const typename rdnn::AlgoChooser<Opr>::FixedTensorLayouts& layouts,
56 size_t arity_in, size_t arity_out, const std::string& delimiter = " -> ") {
57 std::string ret;
58 if (arity_in) {
59 ret.append("(");
60 for (size_t i = 0; i < arity_in; ++i) {
61 if (i) {
62 ret.append(", ");
63 }
64 ret.append(layouts[i].to_string() + " ");
65 }
66 ret.append(")");
67 }
68 if (arity_in && arity_out) {
69 ret.append(delimiter);
70 }
71 if (arity_out) {
72 ret.append("(");
73 for (size_t i = 0; i < arity_out; ++i) {
74 if (i) {
75 ret.append(", ");
76 }
77 ret.append(layouts[i + arity_in].to_string() + " ");
78 }
79 ret.append(")");
80 }
81 return ret;
82}
83
84/**
85 * \brief Check if the sub opr list has circular dependence.

Callers 4

setup_algoMethod · 0.85
profileMethod · 0.85

Calls 2

appendMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected