diff --git a/perception/traffic_light_classifier/utils/trt_common.cpp b/perception/traffic_light_classifier/utils/trt_common.cpp index 4aae3e0ece5e1..f36bf3ba70e3e 100644 --- a/perception/traffic_light_classifier/utils/trt_common.cpp +++ b/perception/traffic_light_classifier/utils/trt_common.cpp @@ -75,8 +75,8 @@ void TrtCommon::setup() } context_ = UniquePtr(engine_->createExecutionContext()); - input_dims_ = engine_->getBindingDimensions(getInputBindingIndex()); - output_dims_ = engine_->getBindingDimensions(getOutputBindingIndex()); + input_dims_ = engine_->getTensorShape(input_name_.c_str()); + output_dims_ = engine_->getTensorShape(output_name_.c_str()); is_initialized_ = true; } @@ -155,8 +155,4 @@ int TrtCommon::getNumOutput() output_dims_.d, output_dims_.d + output_dims_.nbDims, 1, std::multiplies()); } -int TrtCommon::getInputBindingIndex() { return engine_->getBindingIndex(input_name_.c_str()); } - -int TrtCommon::getOutputBindingIndex() { return engine_->getBindingIndex(output_name_.c_str()); } - } // namespace Tn diff --git a/perception/traffic_light_classifier/utils/trt_common.hpp b/perception/traffic_light_classifier/utils/trt_common.hpp index 9577dfd2262a6..7fc3d3b3e46d9 100644 --- a/perception/traffic_light_classifier/utils/trt_common.hpp +++ b/perception/traffic_light_classifier/utils/trt_common.hpp @@ -118,8 +118,6 @@ class TrtCommon bool isInitialized(); int getNumInput(); int getNumOutput(); - int getInputBindingIndex(); - int getOutputBindingIndex(); UniquePtr context_;