import tensorflow as tf

        else:
            if reuse:
                ret.append(tf.variable_scope(
                    tf.get_variable_scope(), reuse=True))
            else:
                # work around https://github.com/tensorflow/tensorflow/issues/14703
                ret.append(tf.variable_scope(tf.get_variable_scope()))
        # always clear existing ns  # TODO check existing ns
        if len(self._name) and self._name != self._vs_name:
            ret.append(tf.name_scope(self._name + '/'))
        return ret

    def _keys_to_freeze(self):
        if self.is_main_training_tower:
            return []
        if self.is_training:
            return [tf.GraphKeys.SUMMARIES, MOVING_SUMMARY_OPS_KEY]
        # freeze UPDATE_OPS during inference because they should never be used
