# BufferInfo

```python
class BufferInfo
```

Struct representing input/output buffer information.

## Attributes

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

### original\_height

```python
property original_height: int
```

Height of original input/output

### original\_width

```python
property original_width: int
```

Width of original input/output

### original\_channel

```python
property original_channel: int
```

Channel of original input/output

### reshaped\_height

```python
property reshaped_height: int
```

Height of reshaped input/output

### reshaped\_width

```python
property reshaped_width: int
```

Width of reshaped input/output

### reshaped\_channel

```python
property reshaped_channel: int
```

Channel of reshaped input/output

### height

```python
property height: int
```

Height of NPU input/output

### width

```python
property width: int
```

Width of NPU input/output

### channel

```python
property channel: int
```

Channel of NPU input/output

### max\_height

```python
property max_height: int
```

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

### max\_width

```python
property max_width: int
```

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

### max\_channel

```python
property max_channel: int
```

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

### max\_cache\_size

```python
property max_cache_size: int
```

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

## Methods

| Name | Description |
| --- | --- |
| [`__init__`](<#init>) |  |
| [`from_cpp`](<#from-cpp>) |  |
| [`original_size`](<#original-size>) | Returns the total size of the original input/output. |
| [`reshaped_size`](<#reshaped-size>) | Returns the total size of the reshaped input/output. |
| [`size`](<#size>) | Returns the total size of the NPU input/output. |
| [`original_shape`](<#original-shape>) |  |
| [`original_shape_chw`](<#original-shape-chw>) |  |
| [`reshaped_shape`](<#reshaped-shape>) |  |
| [`reshaped_shape_chw`](<#reshaped-shape-chw>) |  |
| [`shape`](<#shape>) |  |
| [`shape_chw`](<#shape-chw>) |  |
| [`__repr__`](<#repr>) |  |

### \_\_init\_\_

```python
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

```python
def from_cpp(cls, _buffer_info: _cQbRuntime.BufferInfo)
```

### original\_size

```python
def original_size(self) -> int
```

Returns the total size of the original input/output.

**Returns**

The data size.

### reshaped\_size

```python
def reshaped_size(self) -> int
```

Returns the total size of the reshaped input/output.

**Returns**

The data size.

### size

```python
def size(self) -> int
```

Returns the total size of the NPU input/output.

**Returns**

The data size.

### original\_shape

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

### original\_shape\_chw

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

### reshaped\_shape

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

### reshaped\_shape\_chw

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

### shape

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

### shape\_chw

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

### \_\_repr\_\_

```python
def __repr__(self)
```
