019fa4d7f8216b9a906db49b64e02f9be08c3826,thinc/describe.py,Gradient,__get__,#Gradient#Any#Any#,58
Before Change
if key in obj._mem:
return obj._mem.get(key)
else:
param_key = (obj.id, self.param_name)
grad = obj._mem.add_gradient(key, param_key)
return grad
def __set__(self, obj, val):
After Change
obj._grads[self.name] = GradInfo(self.name, self.param_name, self.text)
def __get__(self, obj, type=None):
return obj.get_grad(self.name)
def __set__(self, obj, value):
return obj.set_grad(self.name, value)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: explosion/thinc
Commit Name: 019fa4d7f8216b9a906db49b64e02f9be08c3826
Time: 2019-12-25
Author: honnibal+gh@gmail.com
File Name: thinc/describe.py
Class Name: Gradient
Method Name: __get__
Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: get_gradients
Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: get_grad