I am implementing some fairly complex criterion function in MXNet. I’d like to both support Gluon and the old way of binding executors.
This means I have to write all my code both using mx.nd and mx.sym, apart from that, it is pretty much the same (I am aware there are differences: I can access shape and dtype in mx.nd, but not in mx.sym. I can overwrite array content in mx.nd, have out=XYZ option, but not in mx.sym. But most is the same).
Is there some trick to avoid having to copy & paste?
Sorry if this is obvious.