74db1a184a17bee6e658851d924c45740888f84a,gpytorch/lazy/constant_mul_lazy_variable.py,ConstantMulLazyVariable,_quad_form_derivative,#ConstantMulLazyVariable#Any#Any#,30
Before Change
if torch.is_tensor(item) and res[i].sum():
res[i] = res[i] * self.constant.expand_as(res[i])
// Gradient with respect to the constant
res.append(left_vecs .new(1).fill_((left_vecs * self.lazy_var._matmul(right_vecs)).sum()))
return res
def _size(self):
After Change
if self.constant.numel() == 1:
constant_deriv = (left_vecs * self.lazy_var._matmul(right_vecs)).sum()
else:
constant_deriv = (left_vecs * self.lazy_var._matmul(right_vecs)).sum(-2, keepdim=True).sum(-1, keepdim=True)
res.append(constant_deriv)
return res
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances 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: _quad_form_derivative
Project Name: allenai/allennlp
Commit Name: 8ba58675175e91d306f55380833458acfcb38cdd
Time: 2018-05-10
Author: pradeep.dasigi@gmail.com
File Name: allennlp/models/semantic_parsing/wikitables/wikitables_erm_semantic_parser.py
Class Name: WikiTablesErmSemanticParser
Method Name: _get_state_cost
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: _quad_form_derivative