Skip to content
heliaEDGE
Reference
HELIA

spec

Typed export specification; importable without Keras or a training backend.

Machine-readable model

  • VALID_IOconstant
  • CALIBRATEDconstant
  • PrecisionclassNumeric format of an exported graph.
  • IODTypeclassElement type of an exported model's inputs and outputs.
  • ConversionModeclassHow the Keras model is traced for conversion.
  • TensorRoleclassRole of a model input or output.
  • state_input_namefunctionName of the input of state pair k.
  • state_output_namefunctionName of the output of state pair k.
  • state_pairfunction("in", k) or ("out", k) for a state tensor name, otherwise None.
  • ExportSpecclassWhat to export.
  • BackendUnavailableclassThe active Keras backend cannot export: LiteRT export needs the TensorFlow backend.
  • check_resetsfunctionRefuse state resets that are not increasing steps from 1 to steps - 1 of a streaming model.
constant

VALID_IO

Python

helia_edge/export/spec.py:71

VALID_IO: dict[Precision, frozenset[IODType]] = {Precision.FP32: frozenset({IODType.FLOAT32}), Precision.FP16: frozenset({IODType.FLOAT16}), Precision.A8W8: frozenset({IODType.INT8, IODType.FLOAT32}), Precision.A16W8: frozenset({IODType.INT16, IODType.FLOAT32})}
class

Precision

Python

Numeric format of an exported graph.

helia_edge/export/spec.py:11

Precision()

Numeric format of an exported graph.

function

("in", k) or ("out", k) for a state tensor name, otherwise None.

helia_edge/export/spec.py:65

state_pair(name: str) -> tuple[str, int] | None

("in", k) or ("out", k) for a state tensor name, otherwise None.

class

What to export.

helia_edge/export/spec.py:81

ExportSpec()

What to export. precision, io_dtype and mode have no defaults.

attribute

strict

Python

helia_edge/export/spec.py:103

strict: StrictBool = True

For calibrated precisions, refuse operators without an integer kernel instead of falling back to float operators. Defaults to True; it does not affect float precisions.

attribute

helia_edge/export/spec.py:104

state_tie_tolerance: StrictFloat = Field(default=0.01, ge=0.0, le=0.5)

For calibrated precisions with integer I/O, export gives each state pair (state_in_k, state_out_k) one scale and zero point covering both tensors’ ranges, and refuses when that scale differs from either original by more than this fraction of it (at most 0.5). Models without state pairs ignore it.

class

The active Keras backend cannot export: LiteRT export needs the TensorFlow backend.

helia_edge/export/spec.py:117

BackendUnavailable()

The active Keras backend cannot export: LiteRT export needs the TensorFlow backend.

function

Refuse state resets that are not increasing steps from 1 to steps - 1 of a streaming model.

helia_edge/export/spec.py:121

check_resets(resets: Collection[int], steps: int, stateful: bool, what: str) -> None

Refuse state resets that are not increasing steps from 1 to steps - 1 of a streaming model.

Errors raised by check_resets
TypeDescription
ValueErrorIf ``resets`` are given for a model without state, or are not increasing steps within the sequence (step 0 always starts from zero states).