execute_with_gradients(func, xs, f=None)¶
Call function func with input of xs variables, and return func first output y, the gradients [dy/dx for x in xs], and any other function outputs after the returned y value
func (function) – Function for which we compute the gradients of the output with respect to xs input.
xs (sequence of variables) – Variables for which to compute the function gradients with respective to.
f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.
the function first output y, the gradients [dy/dx for x in xs], and any other extra function outputs