How to make Zygote's gradient function work with a custom rrule

Here is a link to my issue which describes the problem I am facing: