(self)
| 1922 | ops.add_to_collection(ops.GraphKeys.SAVEABLE_OBJECTS, saveable) |
| 1923 | |
| 1924 | def _create_resource(self): |
| 1925 | # The table must be shared if checkpointing is requested for multi-worker |
| 1926 | # training to work correctly. Use the node name if no shared_name has been |
| 1927 | # explicitly specified. |
| 1928 | use_node_name_sharing = self._checkpoint and self._shared_name is None |
| 1929 | table_ref = gen_lookup_ops.mutable_dense_hash_table_v2( |
| 1930 | empty_key=self._empty_key, |
| 1931 | deleted_key=self._deleted_key, |
| 1932 | shared_name=self._shared_name, |
| 1933 | use_node_name_sharing=use_node_name_sharing, |
| 1934 | value_dtype=self._value_dtype, |
| 1935 | value_shape=self._value_shape, |
| 1936 | initial_num_buckets=self._initial_num_buckets, |
| 1937 | name=self._name) |
| 1938 | if context.executing_eagerly(): |
| 1939 | self._table_name = None |
| 1940 | else: |
| 1941 | self._table_name = table_ref.op.name.split("/")[-1] |
| 1942 | return table_ref |
| 1943 | |
| 1944 | @property |
| 1945 | def name(self): |
no test coverage detected