vart.Runner Example - 2.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2022-06-15
Version
2.5 English
In this example assume we create a DPU runner from a DPU subgraph (called dpu_subgraph).
# create DPU runner
dpu_runner = vart.Runner.create_runner(dpu_subgraph, "run")
 
# get a list of runner inputs
inputTensors = dpu.get_input_tensors()
 
# optional – print names and shapes of each input tensor
for inputTensor in inputTensors:
print('Input tensor :',inputTensor.name, inputTensors.dims)
 
 
# create input buffer
# Important: Order of values passed to DPU thru’ input data buffer must match the order of tensor objects returned by get_input_tensor() 
inputData = []
for inputTensor in inputTensors:
inputData.append(some_input_data.reshape(inputTensor.dims))
 
 
# pass input buffer to DPU runner, launch and wait for completion
job_id = dpu_runner.execute_async(inputData,outputData)
dpu_runner.wait(job_id)