6bca4eed74e22ee369c166649f15db56f8565e35,test/lazy/_lazy_tensor_test_case.py,RectangularLazyTensorTestCase,test_matmul_matrix,#RectangularLazyTensorTestCase#,62

Before Change


        grad = torch.randn_like(res)
        res.backward(gradient=grad)
        actual.backward(gradient=grad)
        for arg, arg_copy in zip(lazy_tensor.representation(), lazy_tensor_copy.representation()):
            if arg_copy.grad is not None:
                self.assertLess(
                    ((arg.grad - arg_copy.grad).abs() / arg_copy.grad.abs().clamp(1, 1e5)).max().item(), 3e-1
                )

    def test_matmul_matrix_broadcast(self):
        // Right hand size has one more batch dimension
        lazy_tensor = self.create_lazy_tensor().requires_grad_(True)
        lazy_tensor_copy = lazy_tensor.clone().detach_().requires_grad_(True)

After Change


    def test_matmul_matrix(self):
        lazy_tensor = self.create_lazy_tensor()
        rhs = torch.randn(*lazy_tensor.batch_shape, lazy_tensor.size(-1), 4)
        return self._test_matmul(rhs)

    def test_matmul_matrix_broadcast(self):
        lazy_tensor = self.create_lazy_tensor()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 6bca4eed74e22ee369c166649f15db56f8565e35
Time: 2019-03-23
Author: gpleiss@gmail.com
File Name: test/lazy/_lazy_tensor_test_case.py
Class Name: RectangularLazyTensorTestCase
Method Name: test_matmul_matrix


Project Name: cornellius-gp/gpytorch
Commit Name: 6bca4eed74e22ee369c166649f15db56f8565e35
Time: 2019-03-23
Author: gpleiss@gmail.com
File Name: test/lazy/_lazy_tensor_test_case.py
Class Name: RectangularLazyTensorTestCase
Method Name: test_matmul_vec


Project Name: cornellius-gp/gpytorch
Commit Name: 47a96974ab2d75fc20c76a6d6da20976ecad32bb
Time: 2017-10-02
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/random_variable.py
Class Name: RandomVariable
Method Name: cpu


Project Name: cornellius-gp/gpytorch
Commit Name: 47a96974ab2d75fc20c76a6d6da20976ecad32bb
Time: 2017-10-02
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/random_variable.py
Class Name: RandomVariable
Method Name: cuda