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

Method __init__

tensorpack/train/trainers.py:129–137  ·  view source on GitHub ↗

Args: gpus ([int]): list of GPU ids. scale_gradient (bool): if True, will scale each gradient by ``1.0/nr_gpu``.

(self, gpus, scale_gradient=True)

Source from the content-addressed store, hash-verified

127
128 @map_arg(gpus=_int_to_range)
129 def __init__(self, gpus, scale_gradient=True):
130 """
131 Args:
132 gpus ([int]): list of GPU ids.
133 scale_gradient (bool): if True, will scale each gradient by ``1.0/nr_gpu``.
134 """
135 self.devices = gpus
136 self._builder = AsyncMultiGPUBuilder(gpus, scale_gradient)
137 super(AsyncMultiGPUTrainer, self).__init__()
138
139 def _setup_graph(self, input, get_cost_fn, get_opt_fn):
140 if len(self.devices) > 1:

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected