Purpose Of Multiple Graphs In Tensorflow

why tensorflow designed to programming with multiple graphs

IDsimpledetailed
1give user more control with over namingA tf.Graph defines the namespace for tf.Operation objects: each operation in a single graph must have a unique name. TensorFlow will “uniquify” the names of operations by appending “_1”, “_2”, and so on to their names if the requested name is already taken. Using multiple explicitly created graphs gives you more control over what name is given to each operation.
2simplify the construction of large graphThe default graph stores information about every tf.Operation and tf.Tensor that was ever added to it. If your program creates a large number of unconnected subgraphs, it may be more efficient to use a different tf.Graph to build each subgraph, so that unrelated state can be garbage collected.

reference

Graphs and Sessions  |  TensorFlow
https://www.tensorflow.org/programmers_guide/graphs

posted on 2017-11-21 11:12  yusisc  阅读(13)  评论(0编辑  收藏  举报

导航