SafetensorsTensor
Models & Types · AiDotNet.Agentic.Models.Local
Metadata for one tensor inside a safetensors file: its name, dtype, shape, and byte range within the data section.
For Beginners
A safetensors file stores many named weight arrays back to back. This is the “table of contents” entry for one of them — what it’s called, its numeric type, its dimensions, and where its bytes live in the file.
Constructors
| Constructor | Summary |
|---|---|
SafetensorsTensor(string name, string dataType, IReadOnlyList<long> shape, long beginByte, long endByte) |
Initializes a new tensor descriptor. |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<long> Shape { get; } |
Gets the tensor shape. |
long BeginByte { get; } |
Gets the start offset within the data section (inclusive). |
long ByteLength { get; } |
Gets the number of bytes occupied by this tensor. |
long ElementCount { get; } |
Gets the total element count (product of Shape; 1 for a scalar). |
long EndByte { get; } |
Gets the end offset within the data section (exclusive). |
string DataType { get; } |
Gets the safetensors dtype string. |
string Name { get; } |
Gets the tensor name. |