59d4bbaaf06850e2dfb357855f50b05f6c9aadb1,syft/frameworks/torch/fl/utils.py,,add_model,#Any#Any#,32

Before Change


    with torch.no_grad():
        for name1, param1 in params1:
            if name1 in dict_params2:
                dict_params2[name1].set_(param1.data + dict_params2[name1].data)
    return dst_model


def scale_model(model, scale):

After Change


    with torch.no_grad():
        for name1 in params1:
            if name1 in params2:
                params1[name1] = params1[name1] + params2[name1]
    model = copy.deepcopy(dst_model)
    model.load_state_dict(params1, strict=False)
    return model
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: OpenMined/PySyft
Commit Name: 59d4bbaaf06850e2dfb357855f50b05f6c9aadb1
Time: 2020-10-02
Author: skywind29@users.noreply.github.com
File Name: syft/frameworks/torch/fl/utils.py
Class Name:
Method Name: add_model


Project Name: OpenMined/PySyft
Commit Name: 59d4bbaaf06850e2dfb357855f50b05f6c9aadb1
Time: 2020-10-02
Author: skywind29@users.noreply.github.com
File Name: syft/frameworks/torch/fl/utils.py
Class Name:
Method Name: scale_model


Project Name: HyperGAN/HyperGAN
Commit Name: c7a185464060fbce142b789c195ddb2156712e38
Time: 2020-08-16
Author: mikkel@255bits.com
File Name: hypergan/backends/roundrobin_backend.py
Class Name: RoundrobinBackend
Method Name: step