[TensorRT EP] update gen_trt_engine_wrapper_onnx_model.py script (#22184)

update script which was using deprecated num_bindings to num_io_tensors
tested on an engine dumped by trtexec and loaded the engine using
onnxruntime-gpu 1.19.2 python package.
This commit is contained in:
George Wu 2024-09-24 14:34:05 -07:00 committed by GitHub
parent 6cc06ad069
commit 7727b4b909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,7 +38,7 @@ class TensorRTEngineWrapperCreator:
# Deserialize an TRT engine
runtime = trt.Runtime(logger)
engine = runtime.deserialize_cuda_engine(engine_buffer)
num_bindings = engine.num_bindings
num_bindings = engine.num_io_tensors
input_tensors = []
output_tensors = []