Let’s look at a simple example, not paying attention to my first post.
I have input input.torch.randn (5,20).
At the exit I have to get (5,1). I applied nn.Linear (20,1).
Now I need to add the third dimension (batch = 10).
My input is input.torch.randn (10,5,20).
Please write me how the Linear should look like to get at the output (10,5)