# helia_edge.utils.tensor

## Tensor Utility API

This module provides utility functions for working with tensors.

**Functions**

| Name | Description |
| --- | --- |
| `matches_spec` | Test whether data object matches the desired spec |

## helia_edge.utils.tensor.SpecType

`attribute` · `python`

```python
SpecType = list[npt.ArrayLike] | tuple[npt.ArrayLike] | dict[str, npt.ArrayLike] | npt.ArrayLike
```

Source: `helia_edge/utils/tensor.py:13`

## helia_edge.utils.tensor.matches_spec

`function` · `python`

```python
matches_spec(o: SpecType, spec: SpecType, ignore_batch_dim: bool = False) -> bool
```

Test whether data object matches the desired spec.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| o | SpecType | Required | Data object. |
| spec | SpecType | Required | Metadata for describing the the data object. |
| ignore_batch_dim | bool | False | Ignore first dimension when checking shapes. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
| bool | bool | If matches |

Source: `helia_edge/utils/tensor.py:16`
