MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

tensorpack/tfutils/sesscreate.py:36–53  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

34
35class 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)

Callers

nothing calls this directly

Calls 1

get_default_sess_configFunction · 0.85

Tested by

no test coverage detected