I also spend a whole week on your code @bodokaiser and as you you mentioned, the blank output problem is so weird! I changed and analyzed all kinds of examinations to find the source of bad behavior, but nothing!!! Everything works as it should!!
I don’t know why the developers pf PyTorch do not pay attention to this weird problem, which I believe is a  clear bug in PyTorch!!
maybe I should mention @apaszke explicitly to grab his attention