4c6458b841bb49610b5cf6b9fbab94df5cad85ee,gpytorch/lazy/interpolated_lazy_tensor.py,InterpolatedLazyTensor,zero_mean_mvn_samples,#InterpolatedLazyTensor#Any#,439

Before Change



    def zero_mean_mvn_samples(self, num_samples):
        base_samples = self.base_lazy_tensor.zero_mean_mvn_samples(num_samples)
        if self.ndimension() == 3:
            res = left_interp(
                self.left_interp_indices, self.left_interp_values, base_samples.permute(1, 2, 0).contiguous()
            )
            return res.permute(2, 0, 1).contiguous()
        else:
            res = left_interp(
                self.left_interp_indices, self.left_interp_values, base_samples.permute(1, 0).contiguous()
            )
            return res.permute(1, 0).contiguous()

    def _getitem_nonbatch(self, row_index, col_index, first_tensor_index_dim=None):
        
        Given an index over rows and columns, gets those items from the LazyTensor.
        Implementing this is not necessary, but it improves performance

After Change


        batch_iter = tuple((i + 1) for i in range(base_samples.dim() - 1))
        base_samples = base_samples.permute(*batch_iter, 0)
        res = left_interp(self.left_interp_indices, self.left_interp_values, base_samples).contiguous()
        batch_iter = tuple(i for i in range(res.dim() - 1))
        return res.permute(-1, *batch_iter).contiguous()

    def _getitem_nonbatch(self, row_index, col_index, first_tensor_index_dim=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 4c6458b841bb49610b5cf6b9fbab94df5cad85ee
Time: 2019-01-23
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/interpolated_lazy_tensor.py
Class Name: InterpolatedLazyTensor
Method Name: zero_mean_mvn_samples


Project Name: cornellius-gp/gpytorch
Commit Name: c517e0b8b34a85b8142b4669c152b6e62c02d8e2
Time: 2019-03-18
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/lazy_tensor.py
Class Name: LazyTensor
Method Name: zero_mean_mvn_samples


Project Name: cornellius-gp/gpytorch
Commit Name: c517e0b8b34a85b8142b4669c152b6e62c02d8e2
Time: 2019-03-18
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/cat_lazy_tensor.py
Class Name: CatLazyTensor
Method Name: _matmul