澄清TensorFlow文档中的tf.name_scope

时间:2017-05-10 07:12:52

标签: tensorflow

TensorFlow documentation提及tf.name_scope

以下内容
This context manager validates that the given values are from the same
graph, makes that graph the default graph, and pushes a name scope in 
that graph.

given values are from the same graph, makes that graph the default graph的含义是什么?

Same graph是指哪个图表?

另外,valuestf.name_scope参数的用途是什么?

1 个答案:

答案 0 :(得分:2)

这只是检查values是作为同一tf.Graph()对象的一部分构建的张量。您的程序中可以有多个tf.Graph(),如果混合两个图形中的节点,可能会发生令人困惑的事情。大多数程序虽然没有这样做,但通常在编写库代码时检查是一件好事。

values参数没有提供此错误检查的其他值。

希望这有帮助!

相关问题