020d3d6dfa1bbcc13f7f7f0a833f57bb2cc8ef9d,gpytorch/lazy/constant_mul_lazy_variable.py,ConstantMulLazyVariable,__init__,#ConstantMulLazyVariable#Any#Any#,12
Before Change
def __init__(self, lazy_var, constant):
if not isinstance(constant, Variable):
tensor_cls = lazy_var.tensor_cls
constant = Variable(tensor_cls(1).fill_(constant))
super(ConstantMulLazyVariable, self).__init__(lazy_var, constant)
self.lazy_var = lazy_var
self.constant = constant
After Change
class ConstantMulLazyVariable(LazyVariable):
def __init__(self, lazy_var, constant):
if torch.is_tensor(constant):
constant = constant
else:
constant = torch.Tensor([constant], device=lazy_var.device)
super(ConstantMulLazyVariable, self).__init__(lazy_var, constant)
self.lazy_var = lazy_var
self.constant = constant
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: cornellius-gp/gpytorch
Commit Name: 020d3d6dfa1bbcc13f7f7f0a833f57bb2cc8ef9d
Time: 2018-07-03
Author: balandat@fb.com
File Name: gpytorch/lazy/constant_mul_lazy_variable.py
Class Name: ConstantMulLazyVariable
Method Name: __init__
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 9964ec22cf4871e3c2939006a0b131de7d1fdb9f
Time: 2018-04-29
Author: max.lapan@gmail.com
File Name: ch13/lib/common.py
Class Name:
Method Name: unpack_batch
Project Name: cornellius-gp/gpytorch
Commit Name: 74db1a184a17bee6e658851d924c45740888f84a
Time: 2018-06-29
Author: ss3765@cornell.edu
File Name: gpytorch/lazy/constant_mul_lazy_variable.py
Class Name: ConstantMulLazyVariable
Method Name: __init__