d030d7b419972323583c3b7378e4de9183ba9192,gpytorch/lazy/constant_mul_lazy_tensor.py,ConstantMulLazyTensor,__getitem__,#ConstantMulLazyTensor#Any#,147

Before Change


        if constant.numel() > 1:
            first_index = i[0] if isinstance(i, tuple) else i
            constant = constant[first_index]
        return self.lazy_var.__getitem__(i) * constant

After Change


        if constant.numel() > 1:
            first_index = i[0] if isinstance(i, tuple) else i
            constant = constant[first_index]
        base_lazy_tensor = self.base_lazy_tensor.__getitem__(i)
        if torch.is_tensor(base_lazy_tensor) and constant.dim() < base_lazy_tensor.dim():
            constant = constant.view(constant.numel(), *([1] * (base_lazy_tensor.dim() - 1)))
        return base_lazy_tensor * constant
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: d030d7b419972323583c3b7378e4de9183ba9192
Time: 2018-10-01
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/constant_mul_lazy_tensor.py
Class Name: ConstantMulLazyTensor
Method Name: __getitem__


Project Name: biolab/orange3
Commit Name: 527664e7f4746f705f3dc06a818b565f68ff78c4
Time: 2013-12-05
Author: anze.staric@gmail.com
File Name: Orange/statistics/contingency.py
Class Name: Discrete
Method Name: __getitem__


Project Name: cesium-ml/cesium
Commit Name: 6071f7da743458dd89f32c58ead163bfaeebbfb3
Time: 2016-02-10
Author: stefanv@berkeley.edu
File Name: mltsp/cfg.py
Class Name: warn_defaultdict
Method Name: __getitem__