Hi,
I try to make custom model which includes;
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.w = [torch.randn((NUM_INPUT), requires_grad=True) for _ in range(NUM_HIDDEN)]
for index in range(NUM_HIDDEN):
self.parameters = nn.ParameterList([self.w[index]])
I did the “nn.ParameterList()” because of error “no parameter” is occurred.
But, running makes an error of;
TypeError: cannot assign 'torch.FloatTensor' object to parameter '0' (torch.nn.Parameter or None required)
Why this error is occurred, and then how to solve it?