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
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
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: interactiveaudiolab/nussl
Commit Name: fa6f47e7aee228226421c52e61cce4e1ab4cc099
Time: 2020-03-15
Author: prem@u.northwestern.edu
File Name: nussl/ml/train/loss.py
Class Name: PermutationInvariantLoss
Method Name: forward
Project Name: cornellius-gp/gpytorch
Commit Name: 1972461c3c06d11872cdf62941a616ee82c858a8
Time: 2018-08-17
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/constant_mul_lazy_variable.py
Class Name: ConstantMulLazyVariable
Method Name: _constant_as