42f67ff9068c3bc92e53f2d624c2bc755de4470f,bootstrap/engines/engine.py,Engine,train_epoch,#Engine#Any#Any#Any#Any#Any#,93

Before Change


                if type(value) == torch.autograd.variable.Variable:
                    value = value.data
                if torch.is_tensor(value):
                    if value.dim() != 1 or value.size(0) != 1:
                        continue
                    else:
                        value = value[0]
                if type(value) == list:

After Change


                if torch.is_tensor(value):
                    if value.dim() == 0:
                        //value = value.detach() // not tracked by autograd anymore
                        value = value.item() // get number from a torch scalar
                    else:
                        continue
                if type(value) == list:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Cadene/bootstrap.pytorch
Commit Name: 42f67ff9068c3bc92e53f2d624c2bc755de4470f
Time: 2018-05-20
Author: remi.cadene@icloud.com
File Name: bootstrap/engines/engine.py
Class Name: Engine
Method Name: train_epoch


Project Name: Cadene/bootstrap.pytorch
Commit Name: 42f67ff9068c3bc92e53f2d624c2bc755de4470f
Time: 2018-05-20
Author: remi.cadene@icloud.com
File Name: bootstrap/engines/engine.py
Class Name: Engine
Method Name: eval_epoch


Project Name: asappresearch/sru
Commit Name: faf3aa876462323f2fa721ebd633752d6489808f
Time: 2020-09-18
Author: taolei@csail.mit.edu
File Name: sru/modules.py
Class Name: SRU
Method Name: forward