MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / process

Method process

tensorpack/tfutils/gradproc.py:32–49  ·  view source on GitHub ↗

Process the symbolic gradients. Args: grads (list): list of (grad, var). Returns: list: processed gradients, with the same type as input.

(self, grads)

Source from the content-addressed store, hash-verified

30 _name_scope = None
31
32 def process(self, grads):
33 """
34 Process the symbolic gradients.
35
36 Args:
37 grads (list): list of (grad, var).
38 Returns:
39 list: processed gradients, with the same type as input.
40 """
41
42 # reuse the old name_scope, if process() is called multiple times
43 if self._name_scope is None:
44 with tfv1.name_scope(type(self).__name__) as scope:
45 self._name_scope = scope
46 return self._process(grads)
47 else:
48 with tfv1.name_scope(self._name_scope):
49 return self._process(grads)
50
51 @abstractmethod
52 def _process(self, grads):

Callers 3

_applyMethod · 0.45
apply_gradientsMethod · 0.45

Calls 1

_processMethod · 0.95

Tested by

no test coverage detected