eac38dbe9694bdfa6c2050528d8cc6a64747e933,pymanopt/autodiff/backends/_autograd.py,_AutogradBackend,compute_gradient,#_AutogradBackend#,38
Before Change
// in the form of `arguments`. This is because autograd wraps tuples and
// lists in `SequenceBox` types which are not derived from tuple or list
// so we cannot detect nested arguments automatically.
unary_function = unpack_arguments(function, signature=arguments)
return autograd.grad(unary_function)
@staticmethod
def _compute_nary_hessian_vector_product(function):
gradient = autograd.grad(function)
After Change
num_arguments = len(arguments)
gradient = autograd.grad(function, argnum=list(range(num_arguments)))
if num_arguments > 1:
return gradient
return self._unpack_return_value(gradient)
@Backend._assert_backend_available
def compute_hessian_vector_product(self, function, arguments):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pymanopt/pymanopt
Commit Name: eac38dbe9694bdfa6c2050528d8cc6a64747e933
Time: 2020-02-01
Author: niklas.koep@gmail.com
File Name: pymanopt/autodiff/backends/_autograd.py
Class Name: _AutogradBackend
Method Name: compute_gradient
Project Name: pymanopt/pymanopt
Commit Name: 775bf75f5a28c56d333fb57f34c4926498ab19be
Time: 2020-02-01
Author: niklas.koep@gmail.com
File Name: pymanopt/autodiff/backends/_theano.py
Class Name: _TheanoBackend
Method Name: compute_gradient
Project Name: pymanopt/pymanopt
Commit Name: 775bf75f5a28c56d333fb57f34c4926498ab19be
Time: 2020-02-01
Author: niklas.koep@gmail.com
File Name: pymanopt/autodiff/backends/_theano.py
Class Name: _TheanoBackend
Method Name: compile_function