Closed hch-baobei closed 1 week ago
No name-based equivalent replacement, you should use multi apis set.
I checked the API documentation and it seems that I can only get a dict of index and name through get_tensor_name. Which APIs do you think can be used to achieve this?
For you ref
for i in range(engine.num_io_tensors):
tensor_name = engine.get_tensor_name(i)
size = trt.volume(engine.get_tensor_shape(tensor_name))
dtype = trt.nptype(engine.get_tensor_dtype(tensor_name))
...
# Append to the appropriate input/output list.
if engine.get_tensor_mode(tensor_name) == trt.TensorIOMode.INPUT:
...
else:
...
tensorrt.ICudaEngine.get_binding_index(tensor name:str)
The above is the usage before version 8.6. I want to know which API can be used in 10.1 to achieve the same effect. The warning in 8.6 suggests get_tensor_name, but after checking the API documentation, I found that it cannot be equivalently replaced.
Then I found that direct [] can be equivalent in 8.6, but an error is reported in 10.1.
so which API equivalent should I use in 10.1?