Engine

class dragon.vm.tensorrt.Engine(
  cuda_engine,
  device_id=0
)[source]

The executing engine with bindings.

__init__

Engine.__init__(
  cuda_engine,
  device_id=0
)[source]

Create an Engine.

Parameters:
  • cuda_engine (tensorrt.ICudaEngine) – The built cuda engine.
  • device_id (int, optional, default=0) – The index of executing device.

Properties

cuda_engine

Engine.cuda_engine

Return the built cuda engine.

Returns:
tensorrt.ICudaEngine – The cuda engine.

inputs

Engine.inputs

Return the input bindings.

Returns:
Sequence[dragon.vm.tensorrt.Binding] – The input bindings.

outputs

Engine.outputs

Return the output bindings.

Returns:
Sequence[dragon.vm.tensorrt.Binding] – The input bindings.

Methods

run

Engine.run(
  inputs,
  optimization_profile=None
)[source]

Execute the engine and return the results.

Parameters:
  • inputs (Union[Sequence, Dict]) – The input numpy arrays.
  • optimization_profile (int, optional) – The index of optimization profile to use.
Returns:

Sequence[numpy.ndarray] – The output arrays.