TensorInfo

data class TensorInfo(val name: String, val shape: List<Long>, val dataType: DataType, val elementCount: Long, val sizeInBytes: Long?, val format: ModelFormat, val nativeDType: String? = null, val skainetDType: String? = null, val canLoadNatively: Boolean = false, val sourceFile: String? = null, val shardIndex: Int? = null, val totalShards: Int? = null)(source)

Unified tensor information across all model formats.

This class provides a format-agnostic representation of tensor metadata, enabling consistent handling regardless of the source format (ONNX, GGUF, etc.).

Constructors

Link copied to clipboard
constructor(name: String, shape: List<Long>, dataType: DataType, elementCount: Long, sizeInBytes: Long?, format: ModelFormat, nativeDType: String? = null, skainetDType: String? = null, canLoadNatively: Boolean = false, sourceFile: String? = null, shardIndex: Int? = null, totalShards: Int? = null)

Properties

Link copied to clipboard

True if this tensor can be loaded into SKaiNET without conversion

Link copied to clipboard

The unified DataType for display and processing

Link copied to clipboard

Total number of elements in the tensor

Link copied to clipboard

The source model format

Link copied to clipboard

Whether this tensor is from a sharded model

Link copied to clipboard

The tensor name

Link copied to clipboard

The original dtype name from the source format (e.g., "F32", "FLOAT")

Link copied to clipboard

The tensor dimensions

Link copied to clipboard

Human-readable shape string, e.g., "3, 224, 224"

Link copied to clipboard

For sharded models, the 1-based shard index

Link copied to clipboard

Formatted shard location, e.g., "1/3"

Link copied to clipboard

Size in bytes (null if unknown or variable)

Link copied to clipboard

Human-readable size string, e.g., "1.5 MB"

Link copied to clipboard

The corresponding SKaiNET DType name, or null if not supported

Link copied to clipboard

For sharded models, the shard filename containing this tensor

Link copied to clipboard

For sharded models, the total number of shards