f2754e0656d8cebe1f785f6af100e4ade241a7f8,thinc/model.py,Model,copy,#Model#,445

Before Change


        for key, value in self._params.items():
            params[key] = None if value is None else self.get_param(key)
        grads = {}
        for key, value in self._grads.items():
            grads[key] = None if value is None else self.get_grad(key)
        copied: Model[InT, OutT] = Model(
            self.name,
            self._func,
            init=self._init,

After Change


            shims=[shim.copy() for shim in self.shims]
        )
        for name in self.grad_names:
            copied.set_grad(name, self.get_grad(name).copy())
        return copied

    def to_gpu(self, gpu_id: int) -> None:  // pragma: no cover
        Transfer the model to a given GPU device.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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: copy


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: finish_update


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: __set__