(self, exc_type, exc_val, exc_tb)
| 136 | return self |
| 137 | |
| 138 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 139 | global _CurrentTowerContext |
| 140 | _CurrentTowerContext = None |
| 141 | |
| 142 | if not self.has_own_variables: |
| 143 | diff_trainable_vars = self._collection_guard.get_collection_in_tower(tf.GraphKeys.TRAINABLE_VARIABLES) |
| 144 | assert len(diff_trainable_vars) == 0, \ |
| 145 | "New TRAINABLE_VARIABLES shouldn't be created in {}: ".format( |
| 146 | self._name) + ', '.join([k.name for k in diff_trainable_vars]) |
| 147 | for c in self._ctxs[::-1]: |
| 148 | c.__exit__(exc_type, exc_val, exc_tb) |
| 149 | return False |
| 150 | |
| 151 | def __str__(self): |
| 152 | return "TowerContext(name={}, is_training={})".format( |
nothing calls this directly
no test coverage detected