It looks like there is a problem in the backward of the cat operation when the given dimension is negative.
You can replace torch.cat((a,b), -1) by torch.cat((a,b), a.dim()-1) as a temporary fix.
I will look into what is causing this bug when I have more time (cc @apaszke )