MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / fillOneBinding

Method fillOneBinding

samples/common/sampleInference.cpp:93–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 int32_t endBindingIndex;
92
93 void fillOneBinding(TensorInfo const& tensorInfo)
94 {
95 auto const name = tensorInfo.name;
96 auto const* bindingInOutStr = tensorInfo.isInput ? "Input" : "Output";
97 for (auto& binding : bindings)
98 {
99 auto const input = inputs.find(name);
100 if (tensorInfo.isInput && input != inputs.end())
101 {
102 sample::gLogInfo << "Using values loaded from " << input->second << " for input " << name << std::endl;
103 binding->addBinding(tensorInfo, input->second);
104 }
105 else
106 {
107 if (tensorInfo.isInput)
108 {
109 sample::gLogInfo << "Using random values for input " << name << std::endl;
110 }
111 binding->addBinding(tensorInfo);
112 }
113 if (tensorInfo.isDynamic)
114 {
115 sample::gLogInfo << bindingInOutStr << " binding for " << name
116 << " is dynamic and will be created during execution using OutputAllocator."
117 << std::endl;
118 }
119 else
120 {
121 sample::gLogInfo << bindingInOutStr << " binding for " << name << " with dimensions " << tensorInfo.dims
122 << " is created." << std::endl;
123 }
124 }
125 }
126
127 bool fillAllBindings(int32_t batch, int32_t endBindingIndex)
128 {

Callers

nothing calls this directly

Calls 2

addBindingMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected