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

Class _TensorProcessor

tensorflow/python/training/optimizer.py:221–236  ·  view source on GitHub ↗

Processor for ordinary Tensors. Even though a Tensor can't really be updated, sometimes it is useful to compute the gradients with respect to a Tensor using the optimizer. Updating the Tensor is, of course, unsupported.

Source from the content-addressed store, hash-verified

219
220
221class _TensorProcessor(_OptimizableVariable):
222 """Processor for ordinary Tensors.
223
224 Even though a Tensor can't really be updated, sometimes it is useful to
225 compute the gradients with respect to a Tensor using the optimizer. Updating
226 the Tensor is, of course, unsupported.
227 """
228
229 def __init__(self, v):
230 self._v = v
231
232 def target(self):
233 return self._v
234
235 def update_op(self, optimizer, g):
236 raise NotImplementedError("Trying to update a Tensor ", self._v)
237
238
239def _get_processor(v):

Callers 1

_get_processorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected