| 200 | |
| 201 | |
| 202 | class 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 | |
| 222 | def get_current_tower_context(): |
no outgoing calls
no test coverage detected