Jiang Xiang
Jiang Xiang

Reputation: 3256

Tensorflow what operations are differentiable and what are not?

In Tensorflow, it is hard to figure out if a function is differentiable or not. For instance, tf.argmax is not differentiable. I am wondering is there any documentation to specify which operations is differentiable?

Upvotes: 4

Views: 2012

Answers (1)

null
null

Reputation: 1217

For math operation, the gradients are registered in this file: tensorflow/tensorflow/python/ops/math_grad.py

For example the gradient of tf.argmax:

@ops.RegisterGradient("ArgMax")
def _ArgMaxGrad(op, grad):
  del op, grad
  return [None, None]

Gradients for other operation can also be found in the same folder.

Upvotes: 1

Related Questions