| 52 | |
| 53 | template <typename Opr> |
| 54 | std::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. |
no test coverage detected