812339ca3d9b68b5f87f9c391aa918f068d5b004,torch/distributed/optim/zero_redundancy_optimizer.py,ZeroRedundancyOptimizer,__init__,#ZeroRedundancyOptimizer#Any#Any#Any#Any#,124

Before Change


        self.optim = optim(self.partition_parameters()[self.rank], **default)

        // - Sync local and global param_groups keys
        for global_group, local_group in zip(
            self.param_groups, self.optim.param_groups
        ):
            for k, v in local_group.items():
                if k != "params":
                    global_group[k] = v

        //  Optional consolidated optimizer state
        self._all_states: List[Dict[str, Any]] = []

        // Current default device is set by the parameters allocated to this rank
        self._device = list(self.per_device_params.keys())[0]

After Change


        self._partition_parameters_cache: List[List[Dict]] = []
        self._index_to_param_cache: Dict[int, torch.Tensor] = {}
        self._all_params = params
        self._reference_is_trainable_mask = list(map(_is_trainable, self._all_params))

        // Build the wrapped optimizer, responsible for a shard of the params
        self.group = group if group is not None else dist.group.WORLD
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pytorch/pytorch
Commit Name: 812339ca3d9b68b5f87f9c391aa918f068d5b004
Time: 2021-03-01
Author: benjamin.lefaudeux@gmail.com
File Name: torch/distributed/optim/zero_redundancy_optimizer.py
Class Name: ZeroRedundancyOptimizer
Method Name: __init__


Project Name: Pinafore/qb
Commit Name: 166cb2c804d081401f0efb52745d214fa633fae1
Time: 2017-04-13
Author: ski.rodriguez@gmail.com
File Name: qanta/guesser/elasticsearch.py
Class Name: ElasticSearchGuesser
Method Name: guess


Project Name: scikit-optimize/scikit-optimize
Commit Name: 544875dd8a7fea49a86e5623d37274159b4ba7b5
Time: 2017-01-10
Author: betatim@gmail.com
File Name: skopt/optimizer/base.py
Class Name:
Method Name: base_minimize