303217b34070dc47a86622b62764098999b0d7f5,gpytorch/lazy/lazy_tensor.py,LazyTensor,_quad_form_derivative,#LazyTensor#Any#Any#,378

Before Change



        loss = (left_vecs * self._matmul(right_vecs)).sum()
        loss.requires_grad_(True)
        grads = torch.autograd.grad(loss, args, allow_unused=True)

        for i, arg in enumerate(args):
            if toggled[i]:
                arg.requires_grad = False

After Change


        with torch.autograd.enable_grad():
            loss = (left_vecs * self._matmul(right_vecs)).sum()
            loss.requires_grad_(True)
            actual_grads = deque(torch.autograd.grad(loss, args_with_grads, allow_unused=True))

        // Now make sure that the object we return has one entry for every item in args
        grads = []
        for arg in args:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 303217b34070dc47a86622b62764098999b0d7f5
Time: 2018-12-12
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/lazy_tensor.py
Class Name: LazyTensor
Method Name: _quad_form_derivative


Project Name: pymanopt/pymanopt
Commit Name: 549694065147889f86d4e0b8406a9562fb7bccf8
Time: 2016-07-29
Author: jamiehntownsend@gmail.com
File Name: pymanopt/tools/autodiff/_autograd.py
Class Name: AutogradBackend
Method Name: compute_gradient


Project Name: pymc-devs/pymc3
Commit Name: b7c0b13a7eebebe6deba6e63b3fe527ea742ca43
Time: 2017-09-02
Author: maxim.v.kochurov@gmail.com
File Name: pymc3/variational/stein.py
Class Name: Stein
Method Name: dlogp


Project Name: pymanopt/pymanopt
Commit Name: 6e4407b927518f6e794e85bd380409a8a1f2d28e
Time: 2020-01-26
Author: niklas.koep@gmail.com
File Name: tests/test_autograd.py
Class Name: TestMixed
Method Name: test_grad


Project Name: pymanopt/pymanopt
Commit Name: 76794c8e8d3339170d06903b1541d7f0d424346c
Time: 2020-01-26
Author: niklas.koep@gmail.com
File Name: tests/test_theano.py
Class Name: TestMixed
Method Name: test_grad