Hi,
That’s because, torch.Tensor([256, channels]) is just a the vector [256, 152064] which a tensor of shape (2,). I think you wanted to do something like x = F.linear(x, torch.randn(256, channels)) or something equivalent. But I don’t really see what you are trying to do, in fact the last layer you just added will have a predefined weight, and won’t be trainable, so what is the reason you are trying to add it?