91b0d220c8e816766fd4565e1d2f5115d3afbefe,test/functions/test_inv_quad_log_det.py,TestInvQuadLogDetBatch,test_log_det_only,#TestInvQuadLogDetBatch#,177

Before Change


        // Forward pass
        with gpytorch.settings.num_trace_samples(1000):
            res = NonLazyTensor(self.mats_var).log_det()
        actual = torch.cat(
            [self.mats_var_clone[0].det().log().unsqueeze(0), self.mats_var_clone[1].det().log().unsqueeze(0)]
        )
        self.assertTrue(approx_equal(res, actual, epsilon=1e-1))

        // Backward
        grad_output = torch.tensor([3, 4], dtype=torch.float)

After Change


            res = NonLazyTensor(self.mats).log_det()
        actual = torch.cat([mat.logdet().unsqueeze(0) for mat in self.mats_clone])
        self.assertEqual(res.shape, actual.shape)
        self.assertLess(torch.max((res - actual).abs()).item(), 1e-1)

        // Backward
        grad_output = torch.randn(5)
        actual.backward(gradient=grad_output)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 91b0d220c8e816766fd4565e1d2f5115d3afbefe
Time: 2018-10-12
Author: gpleiss@gmail.com
File Name: test/functions/test_inv_quad_log_det.py
Class Name: TestInvQuadLogDetBatch
Method Name: test_log_det_only


Project Name: dmlc/dgl
Commit Name: c7f6cf628287b341ddebc9c04ff611fd8c619d4f
Time: 2020-02-17
Author: wmjlyjemaine@gmail.com
File Name: tests/compute/test_heterograph.py
Class Name:
Method Name: test_level2


Project Name: cornellius-gp/gpytorch
Commit Name: 91b0d220c8e816766fd4565e1d2f5115d3afbefe
Time: 2018-10-12
Author: gpleiss@gmail.com
File Name: test/functions/test_inv_quad_log_det.py
Class Name: TestInvQuadLogDetBatch
Method Name: test_inv_quad_log_det_many_vectors