Hi,
I wrote this code and I got this error:
ValueError: optimizer got an empty parameter list

class Conv2d(nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, bias=True):
        super(Conv2d, self).__init__()
        w = torch.empty(kernel_size, kernel_size)
        self.filter = nn.Parameter(nn.init.kaiming_uniform_(w, mode='fan_in', nonlinearity='relu'))
        self.bias = nn.Parameter(torch.zeros(out_channels))
        pass

    def forward(self, x):
        out = F.conv2d(x, self.filter, self.bias, stride=self.stride, padding=self.padding)
        return out

class Model(nn.Module):
    def __init__(self, dropout=None):
        super(Model, self).__init__()
        # in_channels, out_channels, kernel_size, stride=1, padding=0, bias=True:
        conv1 = Conv2d(8, 16, 3, stride=1, padding=1)

    def forward(self, x):
        out = self.conv1(x)
        return out

model = Model()
model.to(device)
for param in model.parameters():
    print(param)
learning_rate = 5e-4
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, amsgrad=False)

Would you have any advice?
Thanks before all