MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / _gen_loader

Function _gen_loader

tools/train_net.py:323–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321 """
322
323 def _gen_loader():
324 for inputs, *_ in loader:
325 if use_gpu:
326 if isinstance(inputs, (list,)):
327 for i in range(len(inputs)):
328 inputs[i] = inputs[i].cuda(non_blocking=True)
329 else:
330 inputs = inputs.cuda(non_blocking=True)
331 yield inputs
332
333 # Update the bn stats.
334 update_bn_stats(model, _gen_loader(), num_iters)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected