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

Class _HashTableProcessor

tensorflow/python/training/optimizer.py:203–218  ·  view source on GitHub ↗

Processor for HashTable.

Source from the content-addressed store, hash-verified

201
202
203class _HashTableProcessor(_OptimizableVariable):
204 """Processor for HashTable."""
205
206 def __init__(self, v):
207 self._v = v
208
209 def target(self):
210 return self._v.handle
211
212 def update_op(self, optimizer, g):
213 # pylint: disable=protected-access
214 if isinstance(g, ops.IndexedSlices):
215 return optimizer._hash_table_apply_sparse_duplicate_indices(
216 g.values, self._v, g.indices)
217 else:
218 raise RuntimeError("HashTable grad should be Sparse not Dense")
219
220
221class _TensorProcessor(_OptimizableVariable):

Callers 1

_get_processorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected