Computes and returns the output dimensions
| 179 | |
| 180 | // Computes and returns the output dimensions |
| 181 | Dims PriorBox::getOutputDimensions(int32_t index, Dims const* inputs, int32_t nbInputDims) noexcept |
| 182 | { |
| 183 | PLUGIN_VALIDATE(nbInputDims == 2); |
| 184 | // Only one output from the plugin layer |
| 185 | PLUGIN_VALIDATE(index == 0); |
| 186 | // Particularity of the PriorBox layer: no batchSize dimension needed |
| 187 | mH = inputs[0].d[1]; |
| 188 | mW = inputs[0].d[2]; |
| 189 | // workaround for TRT |
| 190 | // The first channel is for prior box coordinates. |
| 191 | // The second channel is for prior box scaling factors, which is simply a copy of the variance provided. |
| 192 | return Dims3(2, mH * mW * mNumPriors * 4, 1); |
| 193 | } |
| 194 | |
| 195 | int32_t PriorBox::initialize() noexcept |
| 196 | { |