nndeploy.device.buffer

Classes

Buffer(*args, **kwargs)

class nndeploy.device.buffer.Buffer(*args, **kwargs)[源代码]

基类:Buffer

__init__(*args, **kwargs)[源代码]

Overloaded function.

  1. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, size: int) -> None

  2. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, desc: nndeploy._nndeploy_internal.device.BufferDesc) -> None

  3. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, size: int, ptr: capsule) -> None

  4. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, desc: nndeploy._nndeploy_internal.device.BufferDesc, ptr: capsule) -> None

  5. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, size: int, ptr: capsule, memory_type: nndeploy._nndeploy_internal.base.MemoryType) -> None

  6. __init__(self: nndeploy._nndeploy_internal.device.Buffer, device: nndeploy._nndeploy_internal.device.Device, desc: nndeploy._nndeploy_internal.device.BufferDesc, ptr: capsule, memory_type: nndeploy._nndeploy_internal.base.MemoryType) -> None

  7. __init__(self: nndeploy._nndeploy_internal.device.Buffer, memory_pool: nndeploy._nndeploy_internal.device.MemoryPool, size: int) -> None

  8. __init__(self: nndeploy._nndeploy_internal.device.Buffer, memory_pool: nndeploy._nndeploy_internal.device.MemoryPool, desc: nndeploy._nndeploy_internal.device.BufferDesc) -> None

  9. __init__(self: nndeploy._nndeploy_internal.device.Buffer, memory_pool: nndeploy._nndeploy_internal.device.MemoryPool, size: int, ptr: capsule, memory_type: nndeploy._nndeploy_internal.base.MemoryType) -> None

  10. __init__(self: nndeploy._nndeploy_internal.device.Buffer, memory_pool: nndeploy._nndeploy_internal.device.MemoryPool, desc: nndeploy._nndeploy_internal.device.BufferDesc, ptr: capsule, memory_type: nndeploy._nndeploy_internal.base.MemoryType) -> None

  11. __init__(self: nndeploy._nndeploy_internal.device.Buffer, buffer: nndeploy._nndeploy_internal.device.Buffer) -> None

clone()[源代码]

Clone the buffer

copy_to(dst)[源代码]

Copy the buffer to the destination buffer

serialize(bin_str: str)[源代码]

Serialize the buffer to a binary string

deserialize(bin_str: str)[源代码]

Deserialize the buffer from a binary string

print()[源代码]

Print buffer information

just_modify(size)[源代码]

Modify the buffer size

empty()[源代码]

Check if the buffer is empty

get_device_type()[源代码]

Get the device type of the buffer

get_device()[源代码]

Get the device of the buffer

get_memory_pool()[源代码]

Get the memory pool of the buffer

is_memory_pool()[源代码]

Check if the buffer is from a memory pool

get_desc()[源代码]

Get the buffer descriptor

get_size()[源代码]

Get the size of the buffer

get_size_vector()[源代码]

Get the size vector of the buffer

get_real_size()[源代码]

Get the real size of the buffer

get_real_size_vector()[源代码]

Get the real size vector of the buffer

get_config()[源代码]

Get the configuration of the buffer

get_data()[源代码]

Get the data pointer of the buffer

get_memory_type()[源代码]

Get the memory type of the buffer

add_ref()[源代码]

Increase the reference count of the buffer

sub_ref()[源代码]

Decrease the reference count of the buffer

to_numpy(*args, **kwargs)[源代码]

Convert the buffer to numpy array 支持两种调用方式: 1. to_numpy(dtype) - 直接传入dtype对象 2. to_numpy(dtype_obj) - 传入可转换为dtype的对象

static from_numpy(array)[源代码]

Convert numpy array to buffer

to_numpy_v0(self: nndeploy._nndeploy_internal.device.Buffer, dtype: numpy.dtype) numpy.ndarray

Convert buffer to numpy array with specified dtype

to_numpy_v1(self: nndeploy._nndeploy_internal.device.Buffer, dtype: object) numpy.ndarray

Convert buffer to numpy array with dtype object