Graph runner Example - 2.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2022-06-15
Version
2.5 English
The Graph runner class example is shown below.
// create graph runner
graph = xir.Graph.deserialize(xmodel_file)
runner = vitis_ai_library.GraphRunner.create_graph_runner(graph)
// get input and output tensor buffers
input_tensor_buffers = runner.get_inputs()
output_tensor_buffers = runner.get_outputs()
// run graph runner
v = runner.execute_async(input_tensor_buffers, output_tensor_buffers)
runner.wait(v)
output_data = np.asarray(output_tensor_buffers[0])