I don’t exactly understand, the traceback doesn’t explicitly mention self.wb and self.we. How do you infer about the two weights? They are defined as self.wb = torch.sigmoid(nn.Parameter(torch.zeros(1))). Actually I wanted weights to combine two vectors and I have used them like: ans_beg = torch.mul(self.wb,lb)+torch.mul(1-self.wb,s1). Basically it is just a weight between 0 and 1 that I wanted to define that can be learned by the model so that the two vectors could be effectively averaged. What do you think I need to change in the definition of wb and we?