Thanks! Your answer helped me a lot!
optimizer.zero_grad() is called before out = model(data).
The x.view function gives me a [1,2] instead of a [2], but it actually doesnt matter.
The 432 for ln1 does not work, i put there the value of (x.shape[1] * x.shape[2] * x.shape[3]) which would be 2592 and this works.
The forward funktion does actually work, but i will look into it a quite a bit more.