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

Method getOutputDimensions

plugin/batchedNMSPlugin/batchedNMSPlugin.cpp:144–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142void BatchedNMSDynamicPlugin::terminate() noexcept {}
143
144Dims BatchedNMSPlugin::getOutputDimensions(int32_t index, Dims const* inputs, int32_t nbInputDims) noexcept
145{
146 try
147 {
148 PLUGIN_ASSERT(nbInputDims == 2);
149 PLUGIN_ASSERT(index >= 0 && index < this->getNbOutputs());
150 PLUGIN_ASSERT(inputs[0].nbDims == 3);
151 PLUGIN_ASSERT(inputs[1].nbDims == 2 || (inputs[1].nbDims == 3 && inputs[1].d[2] == 1));
152 // mBoxesSize: number of box coordinates for one sample
153 mBoxesSize = inputs[0].d[0] * inputs[0].d[1] * inputs[0].d[2];
154 // mScoresSize: number of scores for one sample
155 mScoresSize = inputs[1].d[0] * inputs[1].d[1];
156 // num_detections
157 if (index == 0)
158 {
159 Dims dim0{};
160 dim0.nbDims = 0;
161 return dim0;
162 }
163 // nmsed_boxes
164 if (index == 1)
165 {
166 return DimsHW(param.keepTopK, 4);
167 }
168 // nmsed_scores or nmsed_classes
169 Dims dim1{};
170 dim1.nbDims = 1;
171 dim1.d[0] = param.keepTopK;
172 return dim1;
173 }
174 catch (std::exception const& e)
175 {
176 caughtError(e);
177 }
178 return Dims{};
179}
180
181DimsExprs BatchedNMSDynamicPlugin::getOutputDimensions(
182 int32_t outputIndex, DimsExprs const* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept

Callers

nothing calls this directly

Calls 4

getNbOutputsMethod · 0.95
DimsHWClass · 0.85
caughtErrorFunction · 0.85
constantMethod · 0.80

Tested by

no test coverage detected