618c1cac7908e5aa61fd95e0d1c6c1f31a2db95d,pymanopt/core/problem.py,Problem,backend,#Problem#,75
Before Change
@property
def backend(self):
if self._backend is None:
backend_theano = TheanoBackend()
backend_autograd = AutogradBackend()
if backend_theano.is_available():
if backend_theano.is_compatible(self._original_cost,
self._arg):
self._backend = backend_theano
if backend_autograd.is_available():
if backend_autograd.is_compatible(self._original_cost,
self._arg):
self._backend = backend_autograd
if self._backend is None:
raise ValueError(
"Cannot identify an autodiff backend from cost "
"function that also was successfully imported. "
"TheanoBackend was%s successfully imported. " %
("" if backend_theano.is_available() else " not") +
"AutogradBackend was%s successfully imported. " %
("" if backend_autograd.is_available() else " not")
)
After Change
@property
def backend(self):
if self._backend is None:
for backend in self._backends:
if backend.is_compatible(self._original_cost, self._arg):
self._backend = backend
break
else:
backend_names = [backend.name for backend in self._backends]
raise ValueError(
"Cannot determine autodiff backend from cost function. "
"Available backends are: {:s}".format(
", ".join(backend_names)))
return self._backend
@property
def cost(self):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: pymanopt/pymanopt
Commit Name: 618c1cac7908e5aa61fd95e0d1c6c1f31a2db95d
Time: 2016-02-19
Author: niklas.koep@gmail.com
File Name: pymanopt/core/problem.py
Class Name: Problem
Method Name: backend
Project Name: coala/coala-bears
Commit Name: 2bff58313dbd12e5ebc00db492496e864f8eb4db
Time: 2017-08-28
Author: adhika.setyap@gmail.com
File Name: bears/general/CPDBear.py
Class Name: CPDBear
Method Name: run
Project Name: IndicoDataSolutions/finetune
Commit Name: dadb33d17edd0319d2ed6cfe1c23bff4e9d4cdfd
Time: 2020-06-02
Author: benlt@hotmail.co.uk
File Name: finetune/util/metrics.py
Class Name:
Method Name: sequence_labeling_counts
Project Name: deeppomf/DeepCreamPy
Commit Name: 7c0c307a2a8fbdb9b0eb82c275ca8c977aae90f3
Time: 2018-10-30
Author: harjit@harjit.moe
File Name: decensor.py
Class Name: Decensor
Method Name: decensor_all_images_in_folder