I am trying to define a custom CNN layer with some manipulations to weights before forward pass. Below is my implementation:
class Myconv(Linear):
    def __init__(self, in_channels, out_channels, kernel_size, iter, stride=1, padding=0, dilation=1, groups=1,  bias=True):
    super(Myconv, self).__init__(in_channels, out_channels, kernel_size)
    
    self.iter=iter
    self.params = nn.ParameterList([torch.nn.Parameter(torch.randn(out_channels), requires_grad=True) for i in range(self.iter)])
           
    
          
    def modify(self, param):
        ..........          
        return W
    
    @property
    def modifyW(self):
        W=self.modify(self.params)       
        return W   
  
    def forward(self, input):
        return F.conv2d(input, self.modifyW, self.bias)

However, during forward pass I get the error:  ‘Myconv’ object has no attribute ‘modifyW’.
I implemented the same for linear layer using F.linear() and it works fine.
Any help would be appreciated!
thanks!