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

Method __init__

tensorpack/predict/base.py:156–175  ·  view source on GitHub ↗

Args: config (PredictConfig): the config to use.

(self, config)

Source from the content-addressed store, hash-verified

154 """
155
156 def __init__(self, config):
157 """
158 Args:
159 config (PredictConfig): the config to use.
160 """
161 self.graph = config._maybe_create_graph()
162 with self.graph.as_default():
163 input = PlaceholderInput()
164 input.setup(config.input_signature)
165 with PredictTowerContext(''):
166 config.tower_func(*input.get_input_tensors())
167
168 input_tensors = get_tensors_by_names(config.input_names)
169 output_tensors = get_tensors_by_names(config.output_names)
170
171 config.session_init._setup_graph()
172 sess = config.session_creator.create_session()
173 config.session_init._run_init(sess)
174 super(OfflinePredictor, self).__init__(
175 input_tensors, output_tensors, config.return_input, sess)

Callers

nothing calls this directly

Calls 11

PlaceholderInputClass · 0.85
PredictTowerContextClass · 0.85
get_tensors_by_namesFunction · 0.85
_maybe_create_graphMethod · 0.80
setupMethod · 0.80
tower_funcMethod · 0.80
get_input_tensorsMethod · 0.80
_setup_graphMethod · 0.45
create_sessionMethod · 0.45
_run_initMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected