fhelium.serialization.value
Typed value envelopes, validation, and reconstruction.
VALUE_SCHEMA_VERSION
constant View source
python
VALUE_SCHEMA_VERSION = 41
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 description with tensors but no path or store policy.
The envelope is the shared representation for application-owned storage and memory managers. Its tensors may be moved or persisted by the caller, then passed to to_value to reconstruct the original FHElium value type.
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
Describe one live value without choosing storage policy.
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.