4a6ed2b3964a1a8e6679b1d864bfa84504a196ac,inferno/trainers/basic.py,Trainer,get_current_learning_rate,#Trainer#,525

Before Change


        learning_rate = self.optimizer.param_groups[0].get("lr", -1.)
        if torch.is_tensor(learning_rate):
            learning_rate = learning_rate[0]
        return learning_rate

    def cuda(self, devices=None):
        
        Train on the GPU.

After Change


            if there"s just one.
        
        learning_rate = [param_group.get("lr", -1.)
                         for param_group in self.optimizer.param_groups]
        learning_rate = [_learning_rate[0] if thu.is_tensor(_learning_rate) else _learning_rate
                         for _learning_rate in learning_rate]
        return pyu.from_iterable(learning_rate)

    def cuda(self, devices=None):
        
        Train on the GPU.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: inferno-pytorch/inferno
Commit Name: 4a6ed2b3964a1a8e6679b1d864bfa84504a196ac
Time: 2017-07-07
Author: nasim.rahaman@iwr.uni-heidelberg.de
File Name: inferno/trainers/basic.py
Class Name: Trainer
Method Name: get_current_learning_rate


Project Name: pantsbuild/pants
Commit Name: 8c95a5bc7ed0f2cbb2ce126ffb128c5eaa12c32f
Time: 2020-07-28
Author: stuhood@gmail.com
File Name: src/python/pants/backend/python/dependency_inference/rules.py
Class Name:
Method Name: infer_python_init_dependencies


Project Name: pantsbuild/pants
Commit Name: 8c95a5bc7ed0f2cbb2ce126ffb128c5eaa12c32f
Time: 2020-07-28
Author: stuhood@gmail.com
File Name: src/python/pants/backend/python/dependency_inference/rules.py
Class Name:
Method Name: infer_python_conftest_dependencies