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¶
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.
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¶
original_size¶
Returns the total size of the original input/output.
Returns
The data size.
reshaped_size¶
Returns the total size of the reshaped input/output.
Returns
The data size.
size¶
Returns the total size of the NPU input/output.
Returns
The data size.