MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_collection_ref

Method get_collection_ref

tensorflow/python/framework/ops.py:3926–3949  ·  view source on GitHub ↗

Returns a list of values in the collection with the given `name`. If the collection exists, this returns the list itself, which can be modified in place to change the collection. If the collection does not exist, it is created as an empty list and the list is returned. This is dif

(self, name)

Source from the content-addressed store, hash-verified

3924 self.add_to_collection(name, value)
3925
3926 def get_collection_ref(self, name):
3927 """Returns a list of values in the collection with the given `name`.
3928
3929 If the collection exists, this returns the list itself, which can
3930 be modified in place to change the collection. If the collection does
3931 not exist, it is created as an empty list and the list is returned.
3932
3933 This is different from `get_collection()` which always returns a copy of
3934 the collection list if it exists and never creates an empty collection.
3935
3936 Args:
3937 name: The key for the collection. For example, the `GraphKeys` class
3938 contains many standard names for collections.
3939
3940 Returns:
3941 The list of values in the collection with the given `name`, or an empty
3942 list if no value has been added to that collection.
3943 """ # pylint: disable=g-doc-exception
3944 with self._lock:
3945 coll_list = self._collections.get(name, None)
3946 if coll_list is None:
3947 coll_list = []
3948 self._collections[name] = coll_list
3949 return coll_list
3950
3951 def get_collection(self, name, scope=None):
3952 """Returns a list of values in the collection with the given `name`.

Callers 15

testMetaGraphSaveLoadMethod · 0.95
apply_maskFunction · 0.80
buildMethod · 0.80
buildMethod · 0.80
layer_with_recomputeMethod · 0.80
create_train_opFunction · 0.80
_distributed_applyMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 15

testMetaGraphSaveLoadMethod · 0.76
layer_with_recomputeMethod · 0.64
_testPruningMethod · 0.64
testPruningNestedMethod · 0.64
testPruningNested2Method · 0.64
testPruningNested3Method · 0.64
testBasicMethod · 0.64
testNoSwappingMethod · 0.64
testSimpleSwapMethod · 0.64
testBasicCostMethod · 0.64