qbruntime.type.BufferInfo Class Reference

qbruntime.type.BufferInfo Class Reference#

SDK qb Runtime Library: qbruntime.type.BufferInfo Class Reference
SDK qb Runtime Library v1.2
MCS001-EN

Struct representing input/output buffer information. More...

Public Member Functions

 __init__ (self, int original_height=0, int original_width=0, int original_channel=0, int reshaped_height=0, int reshaped_width=0, int reshaped_channel=0, int height=0, int width=0, int channel=0, int max_height=0, int max_width=0, int max_channel=0, int max_cache_size=0)
 from_cpp (cls, _cQbRuntime.BufferInfo _buffer_info)
int original_height (self)
 Height of original input/output.
int original_width (self)
 Width of original input/output.
int original_channel (self)
 Channel of original input/output.
int reshaped_height (self)
 Height of reshaped input/output.
int reshaped_width (self)
 Width of reshaped input/output.
int reshaped_channel (self)
 Channel of reshaped input/output.
int height (self)
 Height of NPU input/output.
int width (self)
 Width of NPU input/output.
int channel (self)
 Channel of NPU input/output.
int max_height (self)
 Maximum height of original input/output if data is sequential.
int max_width (self)
 Maximum width of original input/output if data is sequential.
int max_channel (self)
 Maximum channel of original input/output if data is sequential.
int max_cache_size (self)
 Maximum KV-cache size, relevant for LLM models using KV cache.
 original_height (self, int value)
 original_width (self, int value)
 original_channel (self, int value)
 reshaped_height (self, int value)
 reshaped_width (self, int value)
 reshaped_channel (self, int value)
 height (self, int value)
 width (self, int value)
 channel (self, int value)
 max_height (self, int value)
 max_width (self, int value)
 max_channel (self, int value)
 max_cache_size (self, int value)
int original_size (self)
 Returns the total size of the original input/output.
int reshaped_size (self)
 Returns the total size of the reshaped input/output.
int size (self)
 Returns the total size of the NPU input/output.
Tuple[int, int, int] original_shape (self)
Tuple[int, int, int] original_shape_chw (self)
Tuple[int, int, int] reshaped_shape (self)
Tuple[int, int, int] reshaped_shape_chw (self)
Tuple[int, int, int] shape (self)
Tuple[int, int, int] shape_chw (self)
 __repr__ (self)

Protected Attributes

 _buffer_info = _cQbRuntime.BufferInfo()

Detailed Description

Struct representing input/output buffer information.

Definition at line 219 of file type.py.

Constructor & Destructor Documentation

◆ __init__()

qbruntime.type.BufferInfo.__init__ ( self,
int original_height = 0,
int original_width = 0,
int original_channel = 0,
int reshaped_height = 0,
int reshaped_width = 0,
int reshaped_channel = 0,
int height = 0,
int width = 0,
int channel = 0,
int max_height = 0,
int max_width = 0,
int max_channel = 0,
int max_cache_size = 0 )

Definition at line 222 of file type.py.

Member Function Documentation

◆ from_cpp()

qbruntime.type.BufferInfo.from_cpp ( cls,
_cQbRuntime.BufferInfo _buffer_info )

Definition at line 254 of file type.py.

◆ original_height() [1/2]

int qbruntime.type.BufferInfo.original_height ( self)

Height of original input/output.

Definition at line 272 of file type.py.

◆ original_width() [1/2]

int qbruntime.type.BufferInfo.original_width ( self)

Width of original input/output.

Definition at line 277 of file type.py.

◆ original_channel() [1/2]

int qbruntime.type.BufferInfo.original_channel ( self)

Channel of original input/output.

Definition at line 282 of file type.py.

◆ reshaped_height() [1/2]

int qbruntime.type.BufferInfo.reshaped_height ( self)

Height of reshaped input/output.

Definition at line 287 of file type.py.

◆ reshaped_width() [1/2]

int qbruntime.type.BufferInfo.reshaped_width ( self)

Width of reshaped input/output.

Definition at line 292 of file type.py.

◆ reshaped_channel() [1/2]

int qbruntime.type.BufferInfo.reshaped_channel ( self)

Channel of reshaped input/output.

Definition at line 297 of file type.py.

◆ height() [1/2]

int qbruntime.type.BufferInfo.height ( self)

Height of NPU input/output.

Definition at line 302 of file type.py.

◆ width() [1/2]

int qbruntime.type.BufferInfo.width ( self)

Width of NPU input/output.

Definition at line 307 of file type.py.

◆ channel() [1/2]

int qbruntime.type.BufferInfo.channel ( self)

Channel of NPU input/output.

Definition at line 312 of file type.py.

◆ max_height() [1/2]

int qbruntime.type.BufferInfo.max_height ( self)

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

Definition at line 317 of file type.py.

◆ max_width() [1/2]

int qbruntime.type.BufferInfo.max_width ( self)

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

Definition at line 322 of file type.py.

◆ max_channel() [1/2]

int qbruntime.type.BufferInfo.max_channel ( self)

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

Definition at line 327 of file type.py.

◆ max_cache_size() [1/2]

int qbruntime.type.BufferInfo.max_cache_size ( self)

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

Definition at line 332 of file type.py.

◆ original_height() [2/2]

qbruntime.type.BufferInfo.original_height ( self,
int value )

Definition at line 337 of file type.py.

◆ original_width() [2/2]

qbruntime.type.BufferInfo.original_width ( self,
int value )

Definition at line 341 of file type.py.

◆ original_channel() [2/2]

qbruntime.type.BufferInfo.original_channel ( self,
int value )

Definition at line 345 of file type.py.

◆ reshaped_height() [2/2]

qbruntime.type.BufferInfo.reshaped_height ( self,
int value )

Definition at line 349 of file type.py.

◆ reshaped_width() [2/2]

qbruntime.type.BufferInfo.reshaped_width ( self,
int value )

Definition at line 353 of file type.py.

◆ reshaped_channel() [2/2]

qbruntime.type.BufferInfo.reshaped_channel ( self,
int value )

Definition at line 357 of file type.py.

◆ height() [2/2]

qbruntime.type.BufferInfo.height ( self,
int value )

Definition at line 361 of file type.py.

◆ width() [2/2]

qbruntime.type.BufferInfo.width ( self,
int value )

Definition at line 365 of file type.py.

◆ channel() [2/2]

qbruntime.type.BufferInfo.channel ( self,
int value )

Definition at line 369 of file type.py.

◆ max_height() [2/2]

qbruntime.type.BufferInfo.max_height ( self,
int value )

Definition at line 373 of file type.py.

◆ max_width() [2/2]

qbruntime.type.BufferInfo.max_width ( self,
int value )

Definition at line 377 of file type.py.

◆ max_channel() [2/2]

qbruntime.type.BufferInfo.max_channel ( self,
int value )

Definition at line 381 of file type.py.

◆ max_cache_size() [2/2]

qbruntime.type.BufferInfo.max_cache_size ( self,
int value )

Definition at line 385 of file type.py.

◆ original_size()

int qbruntime.type.BufferInfo.original_size ( self)

Returns the total size of the original input/output.

Returns
The data size.

Definition at line 388 of file type.py.

◆ reshaped_size()

int qbruntime.type.BufferInfo.reshaped_size ( self)

Returns the total size of the reshaped input/output.

Returns
The data size.

Definition at line 396 of file type.py.

◆ size()

int qbruntime.type.BufferInfo.size ( self)

Returns the total size of the NPU input/output.

Returns
The data size.

Definition at line 404 of file type.py.

◆ original_shape()

Tuple[int, int, int] qbruntime.type.BufferInfo.original_shape ( self)

Definition at line 412 of file type.py.

◆ original_shape_chw()

Tuple[int, int, int] qbruntime.type.BufferInfo.original_shape_chw ( self)

Definition at line 415 of file type.py.

◆ reshaped_shape()

Tuple[int, int, int] qbruntime.type.BufferInfo.reshaped_shape ( self)

Definition at line 418 of file type.py.

◆ reshaped_shape_chw()

Tuple[int, int, int] qbruntime.type.BufferInfo.reshaped_shape_chw ( self)

Definition at line 421 of file type.py.

◆ shape()

Tuple[int, int, int] qbruntime.type.BufferInfo.shape ( self)

Definition at line 424 of file type.py.

◆ shape_chw()

Tuple[int, int, int] qbruntime.type.BufferInfo.shape_chw ( self)

Definition at line 427 of file type.py.

◆ __repr__()

qbruntime.type.BufferInfo.__repr__ ( self)

Definition at line 430 of file type.py.

Member Data Documentation

◆ _buffer_info

qbruntime.type.BufferInfo._buffer_info = _cQbRuntime.BufferInfo()
protected

Definition at line 238 of file type.py.


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