tiandiao123 commented on a change in pull request #8808:
URL: https://github.com/apache/tvm/pull/8808#discussion_r696974123
##########
File path: src/runtime/contrib/tensorrt/tensorrt_runtime.cc
##########
@@ -125,17 +146,24 @@ class TensorRTRuntime : public JSONRuntimeBase {
/*! \brief Run inference using built engine. */
void Run() override {
+
auto& engine_and_context = GetOrBuildEngine();
int batch_size = GetBatchSize();
if (batch_size == 0) return;
auto engine = engine_and_context.engine;
auto context = engine_and_context.context;
- std::vector<void*> bindings(engine->getNbBindings(), nullptr);
+ const int num_bindings = engine->getNbBindings();
+ std::vector<void*> bindings(num_bindings, nullptr);
+ std::vector<size_t> binding_sizes(num_bindings, 0);
// Setup input bindings.
+ const size_t num_inputs = input_nodes_.size();
+ int count_inputs = 0;
Review comment:
> We don't need count_inputs, we can just use num_bindings
fixed it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]