bfa0cd26654cda62436b3ff55247996094b0a85f,gpytorch/lazy/lazy_variable.py,LazyVariable,add_diag,#LazyVariable#Any#,69

Before Change


            - diag (Scalar Variable)
        
        from .diag_lazy_variable import DiagLazyVariable
        if len(self.size()) != 2 or (self.size()[0] != self.size()[1]):
            raise RuntimeError("add_diag only defined for square matrices")
        return self + DiagLazyVariable(diag.expand(self.size()[0]))

After Change


        from .diag_lazy_variable import DiagLazyVariable
        if self.size(-1) != self.size(-2):
            raise RuntimeError("add_diag only defined for square matrices")
        if self.ndimension() == 3:
            return self + DiagLazyVariable(diag.unsqueeze(0).expand(self.size(0), self.size(1)))
        else:
            return self + DiagLazyVariable(diag.expand(self.size(0)))

    def add_jitter(self):
        
        Adds jitter (i.e., a small diagonal component) to the matrix this LazyVariable represents.
        This could potentially be implemented as a no-op, however this could lead to numerical instabilities,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: bfa0cd26654cda62436b3ff55247996094b0a85f
Time: 2018-01-10
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/lazy_variable.py
Class Name: LazyVariable
Method Name: add_diag


Project Name: mariogeiger/se3cnn
Commit Name: 9c309a959052ec40cf92cf4baa3894f5118cf8c4
Time: 2019-07-08
Author: geiger.mario@gmail.com
File Name: se3cnn/blocks/point_gated_block.py
Class Name: PointGatedBlock
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: ab4d0a6e6cded5c967d601da6000b8c50b5c65ef
Time: 2017-09-08
Author: ruihan.wu14@gmail.com
File Name: gpytorch/utils/toeplitz.py
Class Name:
Method Name: sym_toeplitz_derivative_quadratic_form