Adds python_grad_func argument to function.Defun.
This allows the gradient for a function to be specified the same way as tf.RegisterGradient (except at the graph scope, rather than global scope). This allows the gradient to be expanded directly in the graph, which in turn enables efficiencies (in memory and space) that do not depend on the graph optimizer (which requires configuration entirely separate from the model definition, and does not always kick in, e.g. when control flow ops are present). Change: 128270792
Loading
Please sign in to comment