I have the following model where I perform a dilated conv2d operation with a 3x3 kernel, as shown in the code with self.cnn4_dialation. I want to perform this dilated convolutional in a way that the center value of the kernel is always to be zero i.e. will not update while training and other values will get updated during the training.
Would anyone please tell me how to do this?
custom kernel format:
a b c
d 0 e
f g h

where a, b, c, d, e, f, g, h are being updated while training.
The defined model:
class base_Model(nn.Module):
    def __init__(self):
        super(base_Model,self).__init__()
        self.cnn1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3, stride=1, padding=1)
        self.relu1 = nn.ReLU()
        self.cnn2 = nn.Conv2d(in_channels=32, out_channels=32, kernel_size=3, stride=1, padding=1)
        self.relu2 = nn.ReLU()
        self.maxpool1 = nn.MaxPool2d(kernel_size=2, stride=2)
        self.cnn3 = nn.Conv2d(in_channels=32, out_channels=100, kernel_size=3, stride=1, padding=1, dilation=1)
        self.relu3 = nn.ReLU()
        self.cnn4_dialation = nn.Conv2d(in_channels=100, out_channels=100, kernel_size=3, stride=1, padding=5, dilation=5)
        self.relu4 = nn.ReLU()
        self.cnn5_1x1 = nn.Conv2d(in_channels=100, out_channels=100, kernel_size=1, stride=1, padding=0)
    def forward(self, x):
        top_layers = self.relu3(self.cnn3(self.maxpool1(self.relu2(self.cnn2(self.relu1(self.cnn1(x)))))))
        out_dialated = self.cnn5_1x1(self.relu4(self.cnn4_dialation(top_layers)))
        return out_dialated