fhelium.serialization.value
Typed value envelopes, validation, and reconstruction.
VALUE_SCHEMA_VERSION
constant View source
python
VALUE_SCHEMA_VERSION = 51
COMPRESSED_PLAINTEXT_FORMAT_VERSION
constant View source
python
COMPRESSED_PLAINTEXT_FORMAT_VERSION = 11
ValueEnvelope
class View source
python
ValueEnvelope(schema_version: int, value_type: str, metadata: dict[str, Any], tensors: dict[str, torch.Tensor])1
A value's serialization metadata and named Tensor payloads.
from_value collects this representation from a live value; to_value reconstructs the corresponding FHElium value from it.
Attributes
| Name | Type | Default/value |
|---|---|---|
schema_version | int | |
value_type | str | |
metadata | dict[str, Any] | |
tensors | dict[str, torch.Tensor] |
from_value
method
python
def from_value(value: TensorResident) -> Self: ...1
Collect one live value's metadata and Tensor payloads.
to_value
method
python
def to_value() -> TensorResident: ...1
Reconstruct the concrete FHElium value type.
nbytes
property
python
nbytes: int1
supported_value_types
function View source
python
def supported_value_types() -> tuple[str, ...]: ...1
validate_value_description
function View source
python
def validate_value_description(*, schema_version: object, value_type: object, metadata: object, tensor_names: set[str], tensor_metadata: dict[str, Any] | None=None) -> None: ...1
Validate a tensor-free value schema description.
Persistence inspection and envelope materialization share this validator, so stale metadata and tensor-name mismatches fail before payload loading.