MCPcopy Create free account
hub / github.com/apache/tvm / _get_supported_layout

Function _get_supported_layout

python/tvm/topi/testing/poolnd_python.py:29–40  ·  view source on GitHub ↗

Returns layout that is supported by poolnd_python based on number of dimensions of input tensor

(dims: int)

Source from the content-addressed store, hash-verified

27
28
29def _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
43def _convert_to_layout(input_tensor: np.ndarray, layout: str) -> np.ndarray:

Callers 2

_convert_to_layoutFunction · 0.85
_convert_from_layoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…