You could use nn.ParameterList:
class MyModule(nn.Module):
    def __init__(self, n):
        super(MyModule, self).__init__()
        self.params = nn.ParameterList([nn.Parameter(torch.randn(1)) for i in range(n)])
     
    def forward(self, x):
        # your forward pass
        return x
        
model = MyModule(5)
list(model.parameters())