Args: target, config: same as :meth:`Session.__init__()`. config: a :class:`tf.ConfigProto` instance, defaults to :func:`tfutils.get_default_sess_config()`
(self, target='', config=None)
| 34 | |
| 35 | class NewSessionCreator(tf.train.SessionCreator): |
| 36 | def __init__(self, target='', config=None): |
| 37 | """ |
| 38 | Args: |
| 39 | target, config: same as :meth:`Session.__init__()`. |
| 40 | config: a :class:`tf.ConfigProto` instance, defaults to :func:`tfutils.get_default_sess_config()` |
| 41 | """ |
| 42 | self.target = target |
| 43 | |
| 44 | if config is None: |
| 45 | # distributed trainer doesn't support user-provided config |
| 46 | # we set this attribute so that they can check |
| 47 | self.user_provided_config = False |
| 48 | config = get_default_sess_config() |
| 49 | else: |
| 50 | self.user_provided_config = True |
| 51 | logger.warn(_WRN1) |
| 52 | logger.warn(_WRN2) |
| 53 | self.config = config |
| 54 | |
| 55 | def create_session(self): |
| 56 | sess = tf.Session(target=self.target, config=self.config) |
nothing calls this directly
no test coverage detected