How to change the batch size?

I’m trying to change the output batch dimension.
ie) [Input] 236 -> [output] 6*8

But I found that the tensorrt library can’t change the output batch dimension.
Even when I’m using nvinfer1::DimsNCHW({6,8,1,1}) in getOutputDimention() function,
I got 506811 shaped tensor, which is the result of adding the batch size of previous node.

Why does not the batch size change?

Hello,

How are you changing the batch dim? Batch information is usually set via:

context->execute(batchSize, &buffers[0])

Thanks for the answer, but I think the way you recommend is to use outside of the plugin.

What if I have to change the batch size of the output inside the plugin?