Returns layout that is supported by poolnd_python based on number of dimensions of input tensor
(dims: int)
| 27 | |
| 28 | |
| 29 | def _get_supported_layout(dims: int): |
| 30 | """ |
| 31 | Returns layout that is supported by poolnd_python based on number of |
| 32 | dimensions of input tensor |
| 33 | """ |
| 34 | assert dims in [3, 4, 5], f"{dims}-dimensional tensor is not supported" |
| 35 | if dims == 3: |
| 36 | return "NCW" |
| 37 | if dims == 4: |
| 38 | return "NCHW" |
| 39 | # dims == 5 |
| 40 | return "NCDHW" |
| 41 | |
| 42 | |
| 43 | def _convert_to_layout(input_tensor: np.ndarray, layout: str) -> np.ndarray: |
no outgoing calls
no test coverage detected
searching dependent graphs…