How to script a derived conv2d using torch.jit

In some neural networks, the covn layer is derived from torch.nn.conv2d, which will cause an exception when scripting the module.
The derived conv2d looks like:
Class Conv2d(torch.nn.conv2d):

Could you include a more detailed repro? Ideally, it should be a self-contained script that we can basically copy + paste and run.