Thank you,
yes, I thought nn.Parameter(x) and nn.Parameter(weight) are problem but If I don’t wrap those parameters with nn.Parameter( ) , I got error like
TypeError: cannot assign ‘torch.cuda.FloatTensor’ as parameter ‘weight’ (torch.nn.Parameter or None expected)
Because torch.where() in transformer function returns torch.cuda.FloatTensor
I don’t know how to I solve this problem