# output

Python API: `luxonis_ml.nn_archive.config_building_blocks.base_models.output`

## Classes

| Name | Description |
| --- | --- |
|
[`Output`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/nn_archive/config_building_blocks/base_models/output.md)
| Model output stream definition. |

### class `Output`

```python
class Output(BaseModelExtraForbid)
```

Model output stream definition.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `dtype` | `DataType` | Data type of the output data, such as `"float32"`. |
| `layout` | `str | None` | Optional letter code for interpreting tensor dimensions, such as `"NC"`. |
| `name` | `str` | Name of the output layer. |
| `shape` | `list[int] | None` | Optional output tensor shape. |

Methods

| Name | Description |
| --- | --- |
|
[`infer_layout`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/nn_archive/config_building_blocks/base_models/output.md)
| Infer the layout when a shape is provided without one. |
|
[`validate_layout`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/nn_archive/config_building_blocks/base_models/output.md)
| Validate that the layout is compatible with the output shape. |

#### method `infer_layout`

```python
def infer_layout() -> Self
```

Infer the layout when a shape is provided without one.

Returns

| Type | Description |
| --- | --- |
| `Self` | The output model with `layout` inferred when possible. |

#### method `validate_layout`

```python
def validate_layout() -> Self
```

Validate that the layout is compatible with the output shape.

The output layout describes every shape axis, so |layout| = |shape| whenever a layout is provided.

Returns

| Type | Description |
| --- | --- |
| `Self` | The validated output model. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If `N` is present but not first, `layout` is provided without `shape`, or layout and shape lengths do not match.
|
