VART-ML  0.3.0
vart::NpuTensorInfo Struct Reference

Metadata structure describing a tensor used in VART. More...

#include <vart_npu_tensor.hpp>

Public Member Functions

void print () const
 

Public Attributes

std::string name
 
DataType data_type = DataType::UNKNOWN
 
TensorDirection direction = TensorDirection::INPUT
 
TensorType tensor_type = TensorType::HW
 
MemoryLayout memory_layout = MemoryLayout::UNKNOWN
 
std::vector< uint32_t > memory_layout_order
 
size_t size = 0
 
size_t size_in_bytes = 0
 
std::vector< uint32_t > shape
 
std::vector< uint32_t > strides
 

Detailed Description

Metadata structure describing a tensor used in VART.

Contains various attributes used to define and manage a tensor:

Member Function Documentation

◆ print()

void vart::NpuTensorInfo::print ( ) const

Prints tensor metadata to standard output.

Member Data Documentation

◆ data_type

vart::NpuTensorInfo::data_type = DataType::UNKNOWN

Data type of the tensor elements.

◆ direction

vart::NpuTensorInfo::direction = TensorDirection::INPUT

Direction of the tensor (input or output).

◆ memory_layout

vart::NpuTensorInfo::memory_layout = MemoryLayout::UNKNOWN

Memory layout type of the tensor.

◆ memory_layout_order

vart::NpuTensorInfo::memory_layout_order

(Optional) Only relevant when memory_layout is GENERIC. Specifies the dimension permutation order for buffer data. This vector defines how dimensions are arranged compared to the reference TensorType::CPU tensor format. For example, if the TensorType::CPU format is "ABCD", memory_layout_order is {0, 1, 2, 3}; if the TensorType::HW format is "ADBC", memory_layout_order is {0, 3, 1, 2}.

◆ name

vart::NpuTensorInfo::name

Name of the tensor.

◆ shape

vart::NpuTensorInfo::shape

Dimensions of the tensor.

◆ size

vart::NpuTensorInfo::size = 0

Number of elements in the tensor.

◆ size_in_bytes

vart::NpuTensorInfo::size_in_bytes = 0

Size of the tensor data in bytes.

◆ strides

vart::NpuTensorInfo::strides

Stride values for each dimension, specified in units of elements.

◆ tensor_type

vart::NpuTensorInfo::tensor_type = TensorType::HW

Type of the tensor (CPU or HW).


The documentation for this struct was generated from the following file: