# layout

Python API: `hubai_sdk.utils.layout`

Infer conventional dimension labels for model tensor shapes.

## Functions

| Name | Description |
| --- | --- |
| [`make_default_layout`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/layout.md) |
Create a likely tensor layout for a shape. |

### function `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'
```

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `shape` | `list[int]` | Tensor dimensions. | required |

Returns

| Type | Description |
| --- | --- |
| `str` | Inferred layout with one letter per dimension. |
