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

Class PredictTowerContext

tensorpack/tfutils/tower.py:202–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202class PredictTowerContext(BaseTowerContext):
203 def __init__(self, ns_name, vs_name=''):
204 super(PredictTowerContext, self).__init__(ns_name, vs_name)
205 self._is_training = False
206
207 self._initial_vs_reuse = tf.get_variable_scope().reuse
208
209 @property
210 def has_own_variables(self):
211 return not self._initial_vs_reuse
212
213 @property
214 def is_main_training_tower(self):
215 return False
216
217 def _keys_to_freeze(self):
218 # freeze UPDATE_OPS during inference because they should never be used
219 return [tf.GraphKeys.SUMMARIES, MOVING_SUMMARY_OPS_KEY, tf.GraphKeys.UPDATE_OPS]
220
221
222def get_current_tower_context():

Callers 10

_setup_graphMethod · 0.85
_setup_graphMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
export_compactMethod · 0.85
export_servingMethod · 0.85
TowerContextFunction · 0.85
get_predictorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected