Hello! I want to know how to add nn.Embedding type variables to model’s parameters. My model is defined as below:
class Model(nn.Module): def __init__(self, a, b, hops): self.W1 = torch.nn.Embedding(a, b) self.W2 = torch.nn.Embedding(a, b) self.R_list =  for i in range(hops): R_list.append(torch.nn.Embedding(a, b))
When I check
W2. are outputed, which means that
R are not in model.paremeters. So I want to know how to add them. Thanks!!
torch.nn.Parameter() can put Tensor type in the model’s parameter.