# helia_edge.export.result

Export results and the environment that produced them; importable without Keras.

## helia_edge.export.result.HeliaEdgeSource

`attribute` · `python`

```python
HeliaEdgeSource = Literal['release', 'vcs', 'local', 'unknown']
```

Source: `helia_edge/export/result.py:17`

## helia_edge.export.result.TensorRecord

`class` · `python`

```python
TensorRecord(
    name: str,
    role: TensorRole,
    shape: tuple[int, ...],
    dtype: IODType,
    scale: float | None,
    zero_point: int | None,
    pair: int | None = None,
) -> None
```

`dataclass`

One model input or output. Dynamic dimensions are -1. I/O tensors are per-tensor quantized; float
tensors have no scale. A state tensor (``role`` STATE) has the index ``pair`` of its state pair.

Source: `helia_edge/export/result.py:20`

### helia_edge.export.result.TensorRecord.name

`attribute` · `python`

```python
name: str
```

Source: `helia_edge/export/result.py:25`

### helia_edge.export.result.TensorRecord.role

`attribute` · `python`

```python
role: TensorRole
```

Source: `helia_edge/export/result.py:26`

### helia_edge.export.result.TensorRecord.shape

`attribute` · `python`

```python
shape: tuple[int, ...]
```

Source: `helia_edge/export/result.py:27`

### helia_edge.export.result.TensorRecord.dtype

`attribute` · `python`

```python
dtype: IODType
```

Source: `helia_edge/export/result.py:28`

### helia_edge.export.result.TensorRecord.scale

`attribute` · `python`

```python
scale: float | None
```

Source: `helia_edge/export/result.py:29`

### helia_edge.export.result.TensorRecord.zero_point

`attribute` · `python`

```python
zero_point: int | None
```

Source: `helia_edge/export/result.py:30`

### helia_edge.export.result.TensorRecord.pair

`attribute` · `python`

```python
pair: int | None = None
```

Source: `helia_edge/export/result.py:31`

## helia_edge.export.result.state_scales_tied

`function` · `python`

```python
state_scales_tied(inputs: Sequence[TensorRecord], outputs: Sequence[TensorRecord]) -> bool | None
```

Whether every integer state pair has one scale and zero point.

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | bool \| None | bool \| None: None when the model has no integer state pair, as for float I/O or a stateless model. |

**Raises**

| Name | Description |
| --- | --- |
| ValueError | If a state tensor has no pair index, or a state input or output has no partner. |

Source: `helia_edge/export/result.py:44`

## helia_edge.export.result.EnvironmentRecord

`class` · `python`

```python
EnvironmentRecord(
    helia_edge: str,
    helia_edge_commit: str | None,
    python: str,
    platform: str,
    packages: tuple[tuple[str, str | None], ...],
    helia_edge_source: HeliaEdgeSource = 'unknown',
) -> None
```

`dataclass`

Versions that can change exported bytes.

``helia_edge`` is ``"unknown"`` when the imported package is not the installed distribution (for
example a source tree on ``PYTHONPATH``). ``helia_edge_commit`` is set only for a distribution
installed from a VCS URL. ``helia_edge_source`` says how the version identifies the code: ``release``
(installed from a package index), ``vcs`` (installed from a VCS URL at ``helia_edge_commit``),
``local`` (installed from a directory or an archive, or a source tree with egg-info metadata, which
the version does not identify) or ``unknown``.

Source: `helia_edge/export/result.py:62`

### helia_edge.export.result.EnvironmentRecord.helia_edge

`attribute` · `python`

```python
helia_edge: str
```

Source: `helia_edge/export/result.py:74`

### helia_edge.export.result.EnvironmentRecord.helia_edge_commit

`attribute` · `python`

```python
helia_edge_commit: str | None
```

Source: `helia_edge/export/result.py:75`

### helia_edge.export.result.EnvironmentRecord.python

`attribute` · `python`

```python
python: str
```

Source: `helia_edge/export/result.py:76`

### helia_edge.export.result.EnvironmentRecord.platform

`attribute` · `python`

```python
platform: str
```

Source: `helia_edge/export/result.py:77`

### helia_edge.export.result.EnvironmentRecord.packages

`attribute` · `python`

```python
packages: tuple[tuple[str, str | None], ...]
```

Source: `helia_edge/export/result.py:78`

### helia_edge.export.result.EnvironmentRecord.helia_edge_source

`attribute` · `python`

```python
helia_edge_source: HeliaEdgeSource = 'unknown'
```

Source: `helia_edge/export/result.py:79`

### helia_edge.export.result.EnvironmentRecord.identified

`attribute` · `python`

```python
identified: bool
```

True when the recorded version or commit identifies the code that ran.

Source: `helia_edge/export/result.py:82`

## helia_edge.export.result.ExportResult

`class` · `python`

```python
ExportResult(
    spec: ExportSpec,
    content: bytes,
    sha256: str,
    inputs: tuple[TensorRecord, ...],
    outputs: tuple[TensorRecord, ...],
    environment: EnvironmentRecord,
) -> None
```

`dataclass`

Exported model bytes with their identity.

Source: `helia_edge/export/result.py:87`

### helia_edge.export.result.ExportResult.spec

`attribute` · `python`

```python
spec: ExportSpec
```

Source: `helia_edge/export/result.py:91`

### helia_edge.export.result.ExportResult.content

`attribute` · `python`

```python
content: bytes
```

Source: `helia_edge/export/result.py:92`

### helia_edge.export.result.ExportResult.sha256

`attribute` · `python`

```python
sha256: str
```

Source: `helia_edge/export/result.py:93`

### helia_edge.export.result.ExportResult.inputs

`attribute` · `python`

```python
inputs: tuple[TensorRecord, ...]
```

Source: `helia_edge/export/result.py:94`

### helia_edge.export.result.ExportResult.outputs

`attribute` · `python`

```python
outputs: tuple[TensorRecord, ...]
```

Source: `helia_edge/export/result.py:95`

### helia_edge.export.result.ExportResult.environment

`attribute` · `python`

```python
environment: EnvironmentRecord
```

Source: `helia_edge/export/result.py:96`

## helia_edge.export.result.environment_record

`function` · `python`

```python
environment_record() -> EnvironmentRecord
```

Describe the running environment.

Source: `helia_edge/export/result.py:131`

## helia_edge.export.result.unidentified_install

`function` · `python`

```python
unidentified_install(record: EnvironmentRecord) -> str
```

Why ``record`` does not identify the helia-edge code, and how to install code that does.

Source: `helia_edge/export/result.py:144`
