Stores `value` in the collection with the given `name`. Note that collections are not sets, so it is possible to add a value to a collection several times. Args: name: The key for the collection. The `GraphKeys` class contains many standard names for collections. va
(self, name, value)
| 3885 | return list(self._collections) |
| 3886 | |
| 3887 | def add_to_collection(self, name, value): |
| 3888 | """Stores `value` in the collection with the given `name`. |
| 3889 | |
| 3890 | Note that collections are not sets, so it is possible to add a value to |
| 3891 | a collection several times. |
| 3892 | |
| 3893 | Args: |
| 3894 | name: The key for the collection. The `GraphKeys` class contains many |
| 3895 | standard names for collections. |
| 3896 | value: The value to add to the collection. |
| 3897 | """ # pylint: disable=g-doc-exception |
| 3898 | self._check_not_finalized() |
| 3899 | with self._lock: |
| 3900 | if name not in self._collections: |
| 3901 | self._collections[name] = [value] |
| 3902 | else: |
| 3903 | self._collections[name].append(value) |
| 3904 | |
| 3905 | def add_to_collections(self, names, value): |
| 3906 | """Stores `value` in the collections given by `names`. |