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

Method getOutputDimensions

plugin/decodeBbox3DPlugin/decodeBbox3D.cpp:134–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134nvinfer1::DimsExprs DecodeBbox3DPlugin::getOutputDimensions(int32_t outputIndex, nvinfer1::DimsExprs const* inputs,
135 int32_t nbInputs, nvinfer1::IExprBuilder& exprBuilder) noexcept
136{
137 try
138 {
139 PLUGIN_VALIDATE(getNbOutputs() == 2);
140 PLUGIN_VALIDATE(outputIndex >= 0 && outputIndex < getNbOutputs());
141 PLUGIN_VALIDATE(inputs != nullptr);
142 auto const& featureH = inputs[0].d[1];
143 auto const& featureW = inputs[0].d[2];
144 auto const& batchSize = inputs[0].d[0];
145 if (outputIndex == 0)
146 {
147 nvinfer1::DimsExprs dim0{};
148 dim0.nbDims = 3;
149 dim0.d[0] = batchSize;
150 dim0.d[1] = exprBuilder.operation(nvinfer1::DimensionOperation::kPROD, featureH[0],
151 exprBuilder.operation(
152 nvinfer1::DimensionOperation::kPROD, featureW[0], exprBuilder.constant(mNumClasses * 2)[0])[0]);
153 dim0.d[2] = exprBuilder.constant(9);
154 return dim0;
155 }
156 nvinfer1::DimsExprs dim1{};
157 dim1.nbDims = 1;
158 dim1.d[0] = batchSize;
159 return dim1;
160 }
161 catch (std::exception const& e)
162 {
163 caughtError(e);
164 }
165 return nvinfer1::DimsExprs{};
166}
167
168bool DecodeBbox3DPlugin::supportsFormatCombination(
169 int32_t pos, nvinfer1::PluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept

Callers

nothing calls this directly

Calls 3

caughtErrorFunction · 0.85
operationMethod · 0.80
constantMethod · 0.80

Tested by

no test coverage detected