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

Before Change


                copied.set_param(name, self.get_param(name))
        for name, is_allocated in self._grads.items():
            if is_allocated:
                copied.set_grad(name, self.get_grad(name))
        return copied

    def to_gpu(self, gpu_id: int) -> None:  // pragma: no cover

After Change


        for name in self.param_names:
            params[name] = self.get_param(name) if self.has_param(name) else None
        for name in self.grad_names:
            grads[name] = self.get_grad(name)

        copied: Model[InT, OutT] = Model(
            self.name,
            self._func,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: ee8819aa148805c3f9ea4b8e4568dada985cd28b
Time: 2020-05-09
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: SequenceCategoricalCrossentropy
Method Name: get_grad


Project Name: explosion/thinc
Commit Name: 7d7dd54986ddc6218acf2db119b287f68111e15a
Time: 2020-05-14
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: SequenceCategoricalCrossentropy
Method Name: __call__


Project Name: explosion/thinc
Commit Name: ee8819aa148805c3f9ea4b8e4568dada985cd28b
Time: 2020-05-09
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: CategoricalCrossentropy
Method Name: __call__