2e90522fc31050358154c9e3a53f7b8e7bf642e7,pymanopt/autodiff/backends/_tensorflow.py,_TensorFlowBackend,__init__,#_TensorFlowBackend#,20

Before Change


class _TensorFlowBackend(Backend):
    def __init__(self):
        if tf is not None:
            self._session = tf.Session()
        super().__init__("TensorFlow")

    @staticmethod
    def is_available():

After Change


        if self.is_available():
            self._session = kwargs.get("session")
            if self._session is None:
                self._own_session = self._session = tf.Session()
        super().__init__("TensorFlow")

    def __del__(self):
        if self._own_session is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pymanopt/pymanopt
Commit Name: 2e90522fc31050358154c9e3a53f7b8e7bf642e7
Time: 2020-01-26
Author: niklas.koep@gmail.com
File Name: pymanopt/autodiff/backends/_tensorflow.py
Class Name: _TensorFlowBackend
Method Name: __init__


Project Name: invesalius/invesalius3
Commit Name: e58244f783849d4efecb44f95e13376e19ed563f
Time: 2011-05-27
Author: paulojamorim@gmail.com
File Name: invesalius/gui/preferences.py
Class Name: Preferences
Method Name: LoadPreferences


Project Name: studioml/studio
Commit Name: d9f9a3ddf61c991e1360f2c5ab4742228176a9df
Time: 2020-12-10
Author: andrei.denissov@cognizant.com
File Name: studio/s3_storage_handler.py
Class Name: S3StorageHandler
Method Name: __init__