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

Method erase

tensorflow/python/ops/lookup_ops.py:2033–2058  ·  view source on GitHub ↗

Removes `keys` and its associated values from the table. If a key is not present in the table, it is silently ignored. Args: keys: Keys to remove. Can be a tensor of any shape. Must match the table's key type. name: A name for the operation (optional). Returns:

(self, keys, name=None)

Source from the content-addressed store, hash-verified

2031 return self.insert_or_assign(keys, values, name)
2032
2033 def erase(self, keys, name=None):
2034 """Removes `keys` and its associated values from the table.
2035
2036 If a key is not present in the table, it is silently ignored.
2037
2038 Args:
2039 keys: Keys to remove. Can be a tensor of any shape. Must match the table's
2040 key type.
2041 name: A name for the operation (optional).
2042
2043 Returns:
2044 The created Operation.
2045
2046 Raises:
2047 TypeError: when `keys` do not match the table data types.
2048 """
2049 if keys.dtype != self._key_dtype:
2050 raise TypeError("Signature mismatch. Keys must be dtype %s, got %s." %
2051 (self._key_dtype, keys.dtype))
2052
2053 with ops.name_scope(name, "%s_lookup_table_remove" % self.name,
2054 (self.resource_handle, keys, self._default_value)):
2055 # pylint: disable=protected-access
2056 op = gen_lookup_ops.lookup_table_remove_v2(self.resource_handle, keys)
2057
2058 return op
2059
2060 def remove(self, keys, name=None):
2061 """Removes `keys` and its associated values from the table.

Callers 4

removeMethod · 0.95
pywrap_tfe_src.ccFile · 0.45
TFE_Py_TapeSetRemoveFunction · 0.45

Calls 1

name_scopeMethod · 0.45

Tested by

no test coverage detected