Implementing backward for a custom layer in gluon

It looks like that gluon custom layers don’t need backward function. (ref )

But I want to write a custom backward. On trying to use the CustomOp interface from mx.nd, I get an error which seems to indicate it’ll not work with gluon (Implementation of weighted softmax by extending mx.autograd.Function fails)

How can I implement backward for a custom layer in gluon?

The CustomOp will work in Gluon. You can follow this tutorial: https://mxnet.incubator.apache.org/versions/master/tutorials/gluon/customop.html