MCPcopy Create free account
hub / github.com/dbolya/yolact / scatter

Method scatter

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

prepare_dataFunction · 0.85

Tested by

no test coverage detected