How to implement a layer plugin whose output shape is mutable?

I am using tensor rt to accelerate R-FCN detection model.

The proposal layer is not supported so I have to write a plugin.

It’s output is related with the input image.

However, I have to implement the getOutputDimensions function of the plugin class.

what should I do ?

Hoping for your reply !