MCPcopy Create free account
hub / github.com/EryiXie/PlaneRecNet / scatter

Method scatter

train.py:159–166  ·  view source on GitHub ↗
(self, inputs, kwargs, device_ids)

Source from the content-addressed store, hash-verified

157
158 """
159 def scatter(self, inputs, kwargs, device_ids):
160 # More like scatter and data prep at the same time. The point is we prep the data in such a way
161 # that no scatter is necessary, and there's no need to shuffle stuff around different GPUs.
162 devices = ['cuda:' + str(x) for x in device_ids]
163 splits = self.prepare_data(inputs[0], devices, allocation=args.batch_alloc)
164
165 return [[split[device_idx] for split in splits] for device_idx in range(len(devices))], \
166 [kwargs] * len(devices)
167
168 def gather(self, outputs, output_device):
169 out = {}

Callers

nothing calls this directly

Calls 1

prepare_dataMethod · 0.95

Tested by

no test coverage detected