class documentation

class Output(BaseModelExtraForbid):

View In Hierarchy

Model output stream definition.

Method infer_layout Infer the layout when a shape is provided without one.
Method validate_layout Validate that the layout is compatible with the output shape.
Instance Variable dtype Data type of the output data, such as "float32".
Instance Variable layout Optional letter code for interpreting tensor dimensions, such as "NC".
Instance Variable name Name of the output layer.
Instance Variable shape Optional output tensor shape.
@model_validator(mode='after')
def infer_layout(self) -> Self:

Infer the layout when a shape is provided without one.

Returns
SelfThe output model with layout inferred when possible.
@model_validator(mode='after')
def validate_layout(self) -> 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
SelfThe validated output model.
Raises
ValueErrorIf N is present but not first, layout is provided without shape, or layout and shape lengths do not match.
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.