Expand description
hurray-inspect — CLI tool for inspecting Hurray files.
§Usage
hurray-inspect [--data[=hex|numpy]] <file>
hurray-inspect - # read from stdinAuto-detects the file type:
- HRRYFILE container (magic
HRRYFILE): displays the file header, trailer, index, KV metadata section, and each tensor’s descriptor. - Raw tensor descriptor (magic
HRRY): displays the descriptor fields.
With --data (or --data=numpy), tensor buffer values are printed after each
descriptor in NumPy-style nested bracket notation. With --data=hex, the raw
buffer bytes are printed as a hex table. For raw descriptors the buffer bytes
must immediately follow the descriptor in the same file.
Macros§
- read_le 🔒
- Decode a fixed-width little-endian integer at element index
idx.
Structs§
- FReader 🔒
- Sequential byte reader that tracks absolute file offsets.
- Reader 🔒
- Cursor over a byte slice bounded to
limitbytes. - Row 🔒
- A single row in the output hex table.
Enums§
Constants§
- FILE_
HEADER_ 🔒SIZE - FILE_
MAGIC 🔒 - FLAG_
HAS_ 🔒INDEX_ CRC32C - FLAG_
HAS_ 🔒KV_ METADATA - FLAG_
SORTED_ 🔒INDEX - NUMPY_
THRESHOLD 🔒 - Maximum number of elements shown before truncation (matches NumPy default).
- TRAILER_
SIZE 🔒
Functions§
- append_
data_ 🔒rows - Append rows displaying the tensor buffer
bufin the chosenDataMode. - e8m0 🔒
- Decodes a
float8_e8m0byte (power-of-two scale;0x00/0xFFreserved → NaN). - file_
flags_ 🔒display - format_
float 🔒 - Format a single float as a string, adding a trailing
.when the value has no fractional part (matching NumPy’s display convention). - format_
numpy 🔒 - Format tensor data as a NumPy-style nested-bracket string.
- format_
numpy_ 🔒dim - Recursively build nested-bracket notation for dimension
depth. - format_
scalar 🔒 - Decode and format the element at logical index
idxfromdata. - hex_
chunks 🔒 - Split
bytesinto groups of at mostper_linebytes and format each as a space-separated hex string. - hex_str 🔒
- Format a byte slice as space-separated uppercase hex pairs (e.g.
"48 52 52 59"). - inspect 🔒
- inspect_
hrryfile 🔒 - inspect_
hrryfile_ 🔒inner - kv_
tag_ 🔒name - layout_
rows 🔒 - layout_
tag_ 🔒name - le_f64 🔒
- le_i64 🔒
- le_u8 🔒
- le_u16 🔒
- le_u32 🔒
- le_u64 🔒
- main 🔒
- micro_
float 🔒 - Decodes an OCP micro-float
code(sign|exponent|mantissa, LSB→MSB) tof64. - parse_
args 🔒 - parse_
kv_ 🔒scalar - parse_
kv_ 🔒section - print_
table 🔒 - Print the 3-column hex table for
rowsto stdout. - quant_
rows 🔒 - Renders the decoded quantization descriptor: the 4-byte header plus the per-scheme fields
(byte-accurate to
quantization/*.md). - quant_
scheme_ 🔒name - read_
f6_ 🔒code - Extracts a 6-bit code at element
idxfrom the 4-elements-per-3-bytes LSB-first packing (element-types.md§ 6-bit packing). - read_
pow2_ 🔒code - Extracts a power-of-two sub-byte code (
bits∈ {1, 2, 4}) at elementidx, LSB-first. - rows_
from_ 🔒descriptor - Build rows for a tensor descriptor.
- run 🔒
- section_
row 🔒 - sign_
extend 🔒 - Sign-extends a
bits-wide two’s-complementcodetoi64. - tiled_
rows 🔒
Type Aliases§
- Result 🔒