Hi,
I’m not sure which link you want?
You look for conv2d in the doc 17 to get all you need.
Here is the code I would do:
import torch
from torch import nn
from torch.nn import functional as F

class MyConv(nn.Conv2d):
    # Assuming you don't want to change the init

    def forward(self, input, mask):
        new_weight = self.weight * mask # or whatever your masking is supposed to do

        return F.conv2d(input, new_weight, self.bias, self.stride,
                        self.padding, self.dilation, self.groups)