What do you mean by “seems like backwards() [is] not working”? Is your model not getting any gradients or are you seeing any other issues?
If the original implementation is working, you could compare both models and try to debug it by adding your changes step by step and make sure the model is still working.