def METHOD_NAME(self, reduce_inv_quad=True, cholesky=False, linear_op=None):
    if not self.__class__.skip_slq_tests:
        # Forward
        if linear_op is None:
            linear_op = self.create_linear_op()
        evaluated = self.evaluate_linear_op(linear_op)
        flattened_evaluated = evaluated.view(-1, *linear_op.matrix_shape)
        vecs = torch.randn(*linear_op.batch_shape, linear_op.size(-1), 3, requires_grad=True)
        vecs_copy = vecs.clone().detach_().requires_grad_(True)
        _wrapped_cg = MagicMock(wraps=linear_operator.utils.linear_cg)
        with patch("linear_operator.utils.linear_cg", new=_wrapped_cg) as linear_cg_mock:
            with linear_operator.settings.num_trace_samples(256), linear_operator.settings.max_cholesky_size(
                math.inf if cholesky else 0
            ), linear_operator.settings.cg_tolerance(1e-5):
                res_inv_quad, res_logdet = linear_op.inv_quad_logdet(
                    inv_quad_rhs=vecs, logdet=True, reduce_inv_quad=reduce_inv_quad
                )
        actual_inv_quad = evaluated.inverse().matmul(vecs_copy).mul(vecs_copy).sum(-2)
        if reduce_inv_quad:
            actual_inv_quad = actual_inv_quad.sum(-1)
        actual_logdet = torch.cat(
            [torch.logdet(flattened_evaluated[i]).unsqueeze(0) for i in range(linear_op.batch_shape.numel())]
        ).view(linear_op.batch_shape)
        self.assertAllClose(res_inv_quad, actual_inv_quad, rtol=0.01, atol=0.01)
        self.assertAllClose(res_logdet, actual_logdet, rtol=0.2, atol=0.03)
        self.assertFalse(linear_cg_mock.called)