# layout

Python API: `hubai_sdk.utils.layout`

Infer conventional dimension labels for model tensor shapes.

## Functions

### make_default_layout

```python
def make_default_layout(shape: list[int]) -> str:
```

Create a likely tensor layout for a shape.

The function recognizes common channel-first and channel-last image shapes. Unrecognized dimensions receive unused letters in
alphabetical order.

> **Example**
> ```pycon
>>> make_default_layout([1, 3, 256, 256])
'NCHW'
>>> make_default_layout([1, 19, 7, 8])
'NABC'
```

Parameters

 * `shape` (`list[int]`): Tensor dimensions.

Returns

 * `str`: Inferred layout with one letter per dimension.
