Binding¶
- class
dragon.vm.tensorrt.
Binding
(
cuda_engine,
execution_context,
idx_or_name,
device_id
)[source]¶ The binding wrapper for an input or output.
__init__¶
Binding.
__init__
(
cuda_engine,
execution_context,
idx_or_name,
device_id
)[source]¶Create a
Binding
.- Parameters:
- cuda_engine (tensorrt.ICudaEngine) – The built cuda engine.
- execution_context (tensorrt.IExecutionContext) – The execution context.
- idx_or_name (Union[int, str]) – The binding index or name.
- device_id (int, optional, default=0) – The index of executing device.
Properties¶
device_buffer¶
Binding.
device_buffer
¶Return the device buffer.
- Returns:
- pycuda.gpuarray.GPUArray – The pycuda array taking the data.
device_dlpack¶
Binding.
device_dlpack
¶Return the dlpack tensor wrapping device buffer.
- Returns:
- PyCapsule – The dlpack tensor object.
host_buffer¶
Binding.
host_buffer
¶Return the host buffer.
- Returns:
- numpy.array – The numpy array taking the data.
host_dlpack¶
Binding.
host_dlpack
¶Return the dlpack tensor wrapping host buffer.
- Returns:
- PyCapsule – The dlpack tensor object.