| 132 | } |
| 133 | |
| 134 | nvinfer1::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 | |
| 168 | bool DecodeBbox3DPlugin::supportsFormatCombination( |
| 169 | int32_t pos, nvinfer1::PluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept |
nothing calls this directly
no test coverage detected