bca150def5e45d0b55d5d20860e3e1b6b6d1ed42,gpytorch/distributions/multivariate_normal.py,MultivariateNormal,rsample,#MultivariateNormal#Any#Any#,146

Before Change


            if covar_root.shape[-1] < base_samples.shape[-2]:
                base_samples = base_samples[..., : covar_root.shape[-1], :]
            elif covar_root.shape[-1] > base_samples.shape[-2]:
                raise RuntimeError("Incompatible dimension of `base_samples`")
            res = covar_root.matmul(base_samples) + self.loc.unsqueeze(-1)

            // Permute and reshape new samples to be original size
            res = res.permute(-1, *range(self.loc.dim())).contiguous()

After Change


                base_samples = base_samples[..., : covar_root.shape[-1], :]
            elif covar_root.shape[-1] > base_samples.shape[-2]:
                // raise RuntimeError("Incompatible dimension of `base_samples`")
                covar_root = covar_root.transpose(-2, -1)
            res = covar_root.matmul(base_samples) + self.loc.unsqueeze(-1)

            // Permute and reshape new samples to be original size
            res = res.permute(-1, *range(self.loc.dim())).contiguous()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: bca150def5e45d0b55d5d20860e3e1b6b6d1ed42
Time: 2021-02-15
Author: wjm363@nyu.edu
File Name: gpytorch/distributions/multivariate_normal.py
Class Name: MultivariateNormal
Method Name: rsample


Project Name: cornellius-gp/gpytorch
Commit Name: 979b8c9efa551e8c948a4aca145367a2d87ac8d6
Time: 2019-02-26
Author: balandat@fb.com
File Name: gpytorch/distributions/multitask_multivariate_normal.py
Class Name: MultitaskMultivariateNormal
Method Name: rsample


Project Name: cornellius-gp/gpytorch
Commit Name: 418f0445cd4baa9457fc23361803ae3c3a32a336
Time: 2020-06-11
Author: kaw293@cornell.edu
File Name: gpytorch/kernels/rff_kernel.py
Class Name: RFFKernel
Method Name: forward