Create a layout node from a string. Parameters ---------- layout_str : str A layout representation is composed of upper cases, lower cases and numbers, where upper case indicates a primal axis and the corresponding lower case with factor size indicates the subord
(layout_str: str, dtype: str = "int32")
| 165 | |
| 166 | |
| 167 | def slayout(layout_str: str, dtype: str = "int32") -> SLayout: |
| 168 | """Create a layout node from a string. |
| 169 | |
| 170 | Parameters |
| 171 | ---------- |
| 172 | layout_str : str |
| 173 | A layout representation is composed of upper cases, lower cases and numbers, |
| 174 | where upper case indicates a primal axis and |
| 175 | the corresponding lower case with factor size indicates the subordinate axis. |
| 176 | For example, NCHW16c can describe a 5-D tensor of |
| 177 | [batch_size, channel, height, width, channel_block]. |
| 178 | Here subordinate axis channel_block=16 is the factor size of |
| 179 | the primal axis C (channel). |
| 180 | |
| 181 | dtype : str |
| 182 | The dtype of generated axes vars in the returned layout. |
| 183 | It is required to be integer type. |
| 184 | |
| 185 | Returns |
| 186 | ------- |
| 187 | layout : SLayout |
| 188 | The created layout |
| 189 | """ |
| 190 | return _ffi_api.SLayout(layout_str, dtype) # type: ignore |
| 191 | |
| 192 | |
| 193 | def sbijective_layout(src_layout: str | SLayout, dst_layout: str | SLayout) -> SBijectiveLayout: |
no outgoing calls
no test coverage detected
searching dependent graphs…