Skip to main content

Module tensor

Module tensor 

Source
Expand description

Tensors as the Python codec carries them (MsgpackEncoder in io_struct.py).

A tensor is the array [dtype, shape, data]. dtype is a torch dtype name ("bfloat16") or a numpy type string ("<f4"); data is the contiguous little-endian bytes, either inline as an ext value with code RAW_VIEW_EXT or, from crate::msgpack::INLINE_THRESHOLD bytes up, the index of the out-of-band frame that holds them.

Structs§

Tensor
A CPU tensor’s metadata and bytes.

Constants§

RAW_VIEW_EXT
Ext code of an inline tensor buffer (CUSTOM_TYPE_RAW_VIEW). Codes 1 and 2 are reserved for pickled payloads, which this protocol never carries.