Different padding in TRT

Description

Hi! I’m trying to import a PyTorch model to TensorRT, but I’m not able to do so because there’s no operation to have different (left, right, top, bottom) padding operator in TensorRT. Can anyone please point me to a relevant resource?

Following is the relevant PyTorch code:

F.max_pool2d(
    F.pad(x, (padding_left, padding_right, padding_top, padding_bottom), mode='replicate'),
    self.size, stride=self.stride
)

Environment

TensorRT Version: 7.1
GPU Type: Jetson NX

Hi @hatake_kakash,

You need to implement custom plugin for the same. For your reference,
https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/samplePlugin

Thank you.