关于tf.variable_scope(_DECODER_SCOPE,_DECODER_SCOPE,...)

时间:2018-06-04 18:03:42

标签: tensorflow

在此program中,有一个代码段

with tf.variable_scope(_DECODER_SCOPE, _DECODER_SCOPE, [features]):
        feature_list = feature_extractor.networks_to_feature_maps[
            model_variant][feature_extractor.DECODER_END_POINTS]
        if feature_list is None:
          tf.logging.info('Not found any decoder end points.')
          return features
        else:

我不清楚如何用这三个参数来理解tf.variable_scope,这用了什么,为什么我们在参数列表中需要两个_DECODER_SCOPE

1 个答案:

答案 0 :(得分:0)

第二个argument to variable_scope是一个“默认”名称,通过附加数字得到了统一。但它仅在第一个参数为None时使用,因此我认为该行等同于:

with tf.variable_scope('decoder', values=[features]):

即。打开名为variable_scope的{​​{1}}。 The values argument to variable_scope is explained in this answer.