schema_access
Typed accessors over the LiteRT flatbuffer object API.
The generated *T classes in schema_py_generated initialise every
vector and table field to None and only fill it in when the flatbuffer
carries that field, so a type checker sees op.inputs as
list | None and flags every iteration, index and attribute access. Read
those fields through the helpers here instead: each one rejects None
with a clear error naming the missing field, and restates the element type
the generated code only records in # type: comments.
Functions
present
Return value, rejecting the None the object API uses for absent fields.
Parameters:
-
(value_T | None) –The field value read from a generated
*Tobject. -
(whatstr) –Human-readable name of the field, used in the error message.
Returns:
-
_T–valueunchanged.
Raises:
-
ValueError–If
valueisNone.
operator_codes_of
The model's operator-code table.
operator_at
The operator at index within subgraph.
tensor_at
The tensor at index within subgraph.
inputs_of
Input tensor indices of an operator or subgraph.
outputs_of
Output tensor indices of an operator or subgraph.
builtin_options
The operator's builtin options table.
The concrete *OptionsT class depends on the operator, so the result is
deliberately untyped; callers read the fields they know exist.