I know it might be duplicate of many of the existing issues already here on this forum but I wasn’t able to figure out problem with my code. I’ve reduced my intricate codebase to the following simple snippet.
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.l1 = torch.zeros(2,2)
def forward(self):
return self.l1
If I print model=Model(); print(list(model.parameters()))
it comes out as empty list, []
, for both of the cases