| 105 | } |
| 106 | |
| 107 | inline std::string DataLayoutToString(const DataLayout& layout) { |
| 108 | switch (layout) { |
| 109 | case DataLayout::NHWC: |
| 110 | return "NHWC"; |
| 111 | case DataLayout::NCHW: |
| 112 | return "NCHW"; |
| 113 | case DataLayout::ANY: |
| 114 | return "Undefined(AnyLayout)"; |
| 115 | case DataLayout::ONEDNN: |
| 116 | return "ONEDNN"; |
| 117 | case DataLayout::SPARSE_COO: |
| 118 | return "SPARSE_COO"; |
| 119 | case DataLayout::SPARSE_CSR: |
| 120 | return "SPARSE_CSR"; |
| 121 | case DataLayout::NDHWC: |
| 122 | return "NDHWC"; |
| 123 | case DataLayout::NCDHW: |
| 124 | return "NCDHW"; |
| 125 | case DataLayout::PSTRING_UNION: |
| 126 | return "PSTRING_UNION"; |
| 127 | case DataLayout::STRIDED: |
| 128 | return "STRIDED"; |
| 129 | default: |
| 130 | PD_THROW("Unknown Data Layout type ", static_cast<int>(layout), "."); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | inline std::ostream& operator<<(std::ostream& os, DataLayout layout) { |
| 135 | os << DataLayoutToString(layout); |
no outgoing calls
no test coverage detected