54dacd356d39f13f7d8152de414bb3a2a49e8bb4,fairseq/optim/adafactor.py,Adafactor,step,#Adafactor#Any#,143

Before Change



                p_data_fp32.add_(-update)

                p.data.copy_(p_data_fp32)

        return loss

After Change


                p_data_fp32.add_(-update)

                // TODO: remove check once pyTorch avoids a copy for this case
                if p.data_ptr() != p_data_fp32.data_ptr():
                    p.data.copy_(p_data_fp32)

        return loss
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 5

Instances


Project Name: elbayadm/attn2d
Commit Name: 54dacd356d39f13f7d8152de414bb3a2a49e8bb4
Time: 2020-03-10
Author: msb@fb.com
File Name: fairseq/optim/adafactor.py
Class Name: Adafactor
Method Name: step


Project Name: pytorch/fairseq
Commit Name: 54dacd356d39f13f7d8152de414bb3a2a49e8bb4
Time: 2020-03-10
Author: msb@fb.com
File Name: fairseq/optim/adam.py
Class Name: Adam
Method Name: step


Project Name: pytorch/fairseq
Commit Name: 54dacd356d39f13f7d8152de414bb3a2a49e8bb4
Time: 2020-03-10
Author: msb@fb.com
File Name: fairseq/optim/nag.py
Class Name: NAG
Method Name: step


Project Name: pytorch/fairseq
Commit Name: 54dacd356d39f13f7d8152de414bb3a2a49e8bb4
Time: 2020-03-10
Author: msb@fb.com
File Name: fairseq/optim/adafactor.py
Class Name: Adafactor
Method Name: step