c10254333ed516c30dd4e50874fa71a2304f2af1,gpytorch/lazy/mul_lazy_variable.py,MulLazyVariable,mul,#MulLazyVariable#Any#,320

Before Change


            return MulLazyVariable(*(list(self.lazy_vars) + list(other.lazy_vars)), matmul_mode=self.matmul_mode)
        elif isinstance(other, LazyVariable):
            if self.added_diag is not None:
                res = list((self, other))
                return MulLazyVariable(*res, matmul_mode=self.matmul_mode)
            return MulLazyVariable(*(list(self.lazy_vars) + [other]), matmul_mode=self.matmul_mode)
        else:
            raise RuntimeError("other must be a LazyVariable, int or float.")

After Change


        return res

    def mul(self, other):
        if isinstance(other, int) or isinstance(other, float) or (isinstance(other, Variable) and other.numel() == 1):
            lazy_vars = list(self.lazy_vars[:-1])
            lazy_vars.append(self.lazy_vars[-1] * other)
            return MulLazyVariable(*lazy_vars)
        elif isinstance(other, MulLazyVariable):
            res = list(self.lazy_vars) + list(other.lazy_vars)
            return MulLazyVariable(*res)
        elif isinstance(other, LazyVariable):
            return MulLazyVariable(*(list(self.lazy_vars) + [other]))
        else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: c10254333ed516c30dd4e50874fa71a2304f2af1
Time: 2018-02-15
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/mul_lazy_variable.py
Class Name: MulLazyVariable
Method Name: mul


Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: update_ngram_scores


Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: ngram