This line in your forward input - bias broadcasts, but in backward you didn’t revert the broadcasting.
I think you’d be better off just use the provided subtraction rather than writing a new autograd.Function… It will be faster and won’t be error-prune.