tf.get_collection()用法

来源:https://tensorflow.google.cn/api_docs/python/tf/get_collection

tf.get_collection(
    key,
    scope=None
)

 Wrapper for Graph.get_collection() using the default graph.

使用默认图形的 Graph.get_collection()的包装器?

Args:

  • key: The key for the collection. For example, the GraphKeys class contains many standard names for collections.
  • scope: (Optional.) If supplied, the resulting list is filtered to include only items whose name attribute matches using re.match. Items without a name attribute are never returned if a scope is supplied and the choice or re.match means that a scope without special tokens filters by prefix.

用来获取一个名称是‘key’的集合中的所有元素,返回的是一个列表,列表的顺序是按照变量放入集合中的先后;   scope参数可选,表示的是名称空间(名称域),如果指定,就返回名称域中所有放入‘key’的变量的列表,不指定则返回所有变量。

你可能感兴趣的:(tf.get_collection()用法)