Skip to main content

Module flatbuf

Module flatbuf 

Source
Expand description

Binary serialization for observation specs.

Provides round-trip serialization of ObsSpec using a compact binary format. The format uses a “MOBS” file identifier and version 1.

Wire format:

[4 bytes] magic "MOBS"
[2 bytes] version (little-endian u16)
[2 bytes] n_entries (little-endian u16)
[n_entries × entry]

Each entry:

[4 bytes] field_id (LE u32)
[1 byte]  region_type
[2 bytes] n_region_params (LE u16)
[n × 4 bytes] region_params (LE i32 each)
[1 byte]  transform_type
[8 bytes] normalize_min (LE f64, if Normalize)
[8 bytes] normalize_max (LE f64, if Normalize)
[1 byte]  dtype
[1 byte]  pool_kernel (0=None)
[4 bytes] pool_kernel_size (LE u32, if pool_kernel != 0)
[4 bytes] pool_stride (LE u32, if pool_kernel != 0)

Functions§

deserialize
Deserialize an ObsSpec from binary bytes.
serialize
Serialize an ObsSpec to binary bytes.