getOutputDimensions for IPluginV2DynamicExt

My CTCGreedyDecoder plugin has tensor input with shape Dims2(88,1, 43) and output is Dims2(1, 20).
So for the getOutputDimensions method,

DimsExprs getOutputDimensions(int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) override

I did as follows.

    DimsExprs getOutputDimensions(int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) override
    {
        nvinfer1::DimsExprs output(inputs[0]);
        output.d[0] = exprBuilder.constant(1);
        output.d[1] = exprBuilder.constant(20);
        output.d[3] = exprBuilder.constant(0);
        return output;
    }

Is that correct?

Hi @edit_or,
Please refer to the below link
https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_plugin_v2_dynamic_ext.html#ad4ed0a21d021ff864aaa162e1f38f502

Thanks!

Yes I got it right already.