The args passed in customGrad(f)(x1, x2,…) must all be tensors. This means that custom ops are less user-friendly than the core ops which all use convertToTensor
to allow them to take TensorLike objects.
I think it would be much nicer if custom ops were first class like the core ops, then library extensions could feel more natural. (I also noticed that convertToTensor
seems to be private, I was expecting it in tf.util
. Might that be exposed as well?)
Thoughts?