From 60dfb85b902e9abc87b82d3f77121eec4af4509f Mon Sep 17 00:00:00 2001 From: gs-olive <113141689+gs-olive@users.noreply.github.com> Date: Wed, 7 Jun 2023 15:51:02 -0700 Subject: [PATCH] fix: Repair index used to access tensor bindings - TRT Index should be used to access tensor names, as opposed to pytorch index --- core/runtime/TRTEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/runtime/TRTEngine.cpp b/core/runtime/TRTEngine.cpp index 14bb832f03..1bca7869e3 100644 --- a/core/runtime/TRTEngine.cpp +++ b/core/runtime/TRTEngine.cpp @@ -111,7 +111,7 @@ TRTEngine::TRTEngine( for (size_t pyt_idx = 0; pyt_idx < inputs_size; pyt_idx++) { auto binding_name = _in_binding_names[pyt_idx]; auto trt_idx = cuda_engine->getBindingIndex(binding_name.c_str()); - std::string engine_binded_name = cuda_engine->getIOTensorName(pyt_idx); + std::string engine_binded_name = cuda_engine->getIOTensorName(trt_idx); TORCHTRT_CHECK( (binding_name == engine_binded_name), "Could not find a TensorRT engine binding for input named " << binding_name);