874da9a25fd4f1d8aac44d29c365fa2143f7793e,python/ray/util/sgd/torch/training_operator.py,TrainingOperator,register,#TrainingOperator#,167

Before Change


        else:
            return_vals.append(self._models)

        if len(self._optimizers) == 1:
            return_vals.append(self._optimizers[0])
        else:
            return_vals.append(self._optimizers)

        if self._criterion is not None:
            return_vals.append(self._criterion)

        if self._schedulers is not None:

After Change


            if not isinstance(self._schedulers, Iterable):
                self._schedulers = [self._schedulers]
        else:
            if isinstance(schedulers, Iterable):
                self._schedulers = []
            else:
                self._schedulers = None

        if criterion:
            logger.debug("Registering loss.")
            self._criterion = criterion
            if self.use_gpu and torch.cuda.is_available():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: ray-project/ray
Commit Name: 874da9a25fd4f1d8aac44d29c365fa2143f7793e
Time: 2020-10-01
Author: amogkam@users.noreply.github.com
File Name: python/ray/util/sgd/torch/training_operator.py
Class Name: TrainingOperator
Method Name: register


Project Name: ray-project/ray
Commit Name: 6373c706615bc94c0a1e7fc564b3d18c3d342d91
Time: 2020-04-30
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/api.py
Class Name:
Method Name: create_backend


Project Name: NervanaSystems/coach
Commit Name: 582921ffe3b04ff502e1c3a05088ba2902e0f5bd
Time: 2019-05-02
Author: gal.leibovich@intel.com
File Name: rl_coach/agents/value_optimization_agent.py
Class Name: ValueOptimizationAgent
Method Name: run_off_policy_evaluation