콘텐츠로 이동

BufferInfo

class BufferInfo

Struct representing input/output buffer information.

Attributes

Name Description
original_height Height of original input/output
original_width Width of original input/output
original_channel Channel of original input/output
reshaped_height Height of reshaped input/output
reshaped_width Width of reshaped input/output
reshaped_channel Channel of reshaped input/output
height Height of NPU input/output
width Width of NPU input/output
channel Channel of NPU input/output
max_height Maximum height of original input/output if data is sequential.
max_width Maximum width of original input/output if data is sequential.
max_channel Maximum channel of original input/output if data is sequential.
max_cache_size Maximum KV-cache size, relevant for LLM models using KV cache.

original_height

property original_height: int

Height of original input/output

original_width

property original_width: int

Width of original input/output

original_channel

property original_channel: int

Channel of original input/output

reshaped_height

property reshaped_height: int

Height of reshaped input/output

reshaped_width

property reshaped_width: int

Width of reshaped input/output

reshaped_channel

property reshaped_channel: int

Channel of reshaped input/output

height

property height: int

Height of NPU input/output

width

property width: int

Width of NPU input/output

channel

property channel: int

Channel of NPU input/output

max_height

property max_height: int

Maximum height of original input/output if data is sequential.

max_width

property max_width: int

Maximum width of original input/output if data is sequential.

max_channel

property max_channel: int

Maximum channel of original input/output if data is sequential.

max_cache_size

property max_cache_size: int

Maximum KV-cache size, relevant for LLM models using KV cache.

Methods

Name Description
__init__
from_cpp
original_size Returns the total size of the original input/output.
reshaped_size Returns the total size of the reshaped input/output.
size Returns the total size of the NPU input/output.
original_shape
original_shape_chw
reshaped_shape
reshaped_shape_chw
shape
shape_chw
__repr__

__init__

def __init__(
    self,
    original_height: int = 0,
    original_width: int = 0,
    original_channel: int = 0,
    reshaped_height: int = 0,
    reshaped_width: int = 0,
    reshaped_channel: int = 0,
    height: int = 0,
    width: int = 0,
    channel: int = 0,
    max_height: int = 0,
    max_width: int = 0,
    max_channel: int = 0,
    max_cache_size: int = 0,
)

from_cpp

def from_cpp(cls, _buffer_info: _cQbRuntime.BufferInfo)

original_size

def original_size(self) -> int

Returns the total size of the original input/output.

Returns

The data size.

reshaped_size

def reshaped_size(self) -> int

Returns the total size of the reshaped input/output.

Returns

The data size.

size

def size(self) -> int

Returns the total size of the NPU input/output.

Returns

The data size.

original_shape

def original_shape(self) -> Tuple[int, int, int]

original_shape_chw

def original_shape_chw(self) -> Tuple[int, int, int]

reshaped_shape

def reshaped_shape(self) -> Tuple[int, int, int]

reshaped_shape_chw

def reshaped_shape_chw(self) -> Tuple[int, int, int]

shape

def shape(self) -> Tuple[int, int, int]

shape_chw

def shape_chw(self) -> Tuple[int, int, int]

__repr__

def __repr__(self)