# typing

Python API: `luxonis_train.typing`

The type aliases shared across the package.

## Module Attributes

| Name | Type | Description |
| --- | --- | --- |
| [`AttachIndexType`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/typing.md#typing-Module-Attributes-AttachIndexType) | `TypeAlias` | The outputs of the input node that a node reads. |
| [`Labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/typing.md#typing-Module-Attributes-Labels) | `TypeAlias` | The label tensors of a sample or a batch, keyed by task and label. |
| [`Packet`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/typing.md#typing-Module-Attributes-Packet) | `TypeAlias` | A dictionary that maps output names to values or to lists of values. |
| [`T`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/typing.md#typing-Module-Attributes-T) |  | `Tensor` or `Size`. |
| [`View`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/typing.md#typing-Module-Attributes-View) | `TypeAlias` | `"train"`, `"val"`, or `"test"`. |

### type alias `AttachIndexType`

```python
AttachIndexType: TypeAlias = Literal[
    'all',
] | int | tuple[int, int] | tuple[int, int, int] | None
```

The outputs of the input node that a node reads.

The value is `"all"` for every output, or an integer index for one output. A tuple of two integers selects a range, and a third
integer sets the step of the range. `None` means that the index is not set.
[BaseNode.get_attached](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/nodes/base_node.md#base_node-Classes-BaseNode-get_attached)
applies the index.

### type alias `Labels`

```python
Labels: TypeAlias = dict[str, Tensor]
```

The label tensors of a sample or a batch, keyed by task and label.

A key has the form `"<task_name>/<label>"`, where `<task_name>` is the dataset task. Examples are `"detection/boundingbox"` and
`"detection/metadata/id"`.

### type alias `Packet`

```python
Packet: TypeAlias = dict[str, list[T] | T]
```

A dictionary that maps output names to values or to lists of values.

The values of one packet are all tensors or all sizes. A node reads packets of tensors and returns a packet of tensors, for
example `{"features": [f1, f2]}`. A packet of sizes holds the shapes of the outputs of a node.

### type variable `T`

```python
T = TypeVar('T', Tensor, Size)
```

`Tensor` or `Size`.

### type alias `View`

```python
View: TypeAlias = Literal['train', 'val', 'test']
```

`"train"`, `"val"`, or `"test"`.

[LuxonisModel](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/core/core.md#core-Classes-LuxonisModel)
builds one loader for each view.
