d51dd50f93232f5542df1a8ccb2d91cee17c52d8,grid/app/main/sfl/cycles/cycle_manager.py,CycleManager,_average_plan_diffs,#CycleManager#Any#Any#,210

Before Change


        ]

        // Again, not sure max_workers == number of diffs to avg
        diffs = random.sample(diffs, server_config.get("max_workers"))

        raw_diffs = [
            [diff[model_param] for diff in diffs]
            for model_param in range(len(model_params))
        ]
        logging.info("raw diffs lengths: %s" % str([len(row) for row in raw_diffs]))

        sums = [reduce(th.add, param) for param in raw_diffs]
        logging.info("sums shapes: %s" % str([sum.shape for sum in sums]))

        diff_avg = [th.div(param, len(diffs)) for param in sums]
        logging.info("diff_avg shapes: %s" % str([d.shape for d in diff_avg]))

After Change



        if iterative_plan:
            diff_avg = raw_diffs[0]
            for i, diff in enumerate(raw_diffs[1:]):
                diff_avg = avg_plan(diff_avg, diff, i + 1)
        else:
            diff_avg = avg_plan(raw_diffs)

        logging.info("diff_avg shapes: %s" % str([d.shape for d in diff_avg]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: OpenMined/Grid
Commit Name: d51dd50f93232f5542df1a8ccb2d91cee17c52d8
Time: 2020-07-08
Author: hericles.me@gmail.com
File Name: grid/app/main/sfl/cycles/cycle_manager.py
Class Name: CycleManager
Method Name: _average_plan_diffs


Project Name: nilearn/nilearn
Commit Name: 967eca1cc7511c793fed8ee92da80ee405f07921
Time: 2016-05-23
Author: mperezguevara@gmail.com
File Name: nilearn/plotting/displays.py
Class Name: OrthoSlicer
Method Name: _locator


Project Name: onnx/onnx-coreml
Commit Name: ffed6ce438fc1ebdc8054d307ffdfce4bbf2f7f1
Time: 2019-09-03
Author: bhushan.s.94@gmail.com
File Name: onnx_coreml/_transformers.py
Class Name: GatherConstantRemover
Method Name: __call__