Hey,
Yet another basic question.
Code became large, sharing Github gist: https://gist.github.com/av-maslov/ae0cafe88eb6d315335e0b99a4de4ef1 2
The code is self-contained, you can run it by copy-paste (if dependencies are installed).
Output dimensions for model’s outputs differs from output dimensions for target within same batch.
If I set BATCH_SIZES=(4,4) code posted above generates output:
torch.Size([9, 3]) torch.Size([4, 3])
torch.Size([5, 3]) torch.Size([4, 3])
torch.Size([7, 3]) torch.Size([4, 3])
torch.Size([4, 3]) torch.Size([4, 3])
torch.Size([9, 3]) torch.Size([4, 3])
torch.Size([8, 3]) torch.Size([4, 3])

Batch size enforced only for the target. (?)
How can I compute loss function if dimensions are different?
How to fix it?