Tensorflow: How to write op with gradient in python?
Yes, as mentionned in @Yaroslav’s answer, it is possible and the key is the links he references: here and here. I want to elaborate on this answer by giving a concret example. Modulo opperation: Let’s implement the element-wise modulo operation in tensorflow (it already exists but its gradient is not defined, but for the example … Read more