PyTorch nn.module won't unbatch operations
PyTorch nn.module won't unbatch operations Question: I have a nn.Module whose forward function takes in two inputs. Inside the function, I multiply one of the inputs x1 by a set of trainable parameters, and then concatenate them with the other input x2. class ConcatMe(nn.Module): def __init__(self, pad_len, emb_size): super(ConcatMe, self).__init__() self.W = nn.Parameter(torch.randn(pad_len, emb_size).to(DEVICE), requires_grad=True) …