MCPcopy Index your code
hub / github.com/openai/guided-diffusion / split_microbatches

Function split_microbatches

scripts/classifier_train.py:193–199  ·  view source on GitHub ↗
(microbatch, *args)

Source from the content-addressed store, hash-verified

191
192
193def split_microbatches(microbatch, *args):
194 bs = len(args[0])
195 if microbatch == -1 or microbatch >= bs:
196 yield tuple(args)
197 else:
198 for i in range(0, bs, microbatch):
199 yield tuple(x[i : i + microbatch] if x is not None else None for x in args)
200
201
202def create_argparser():

Callers 1

forward_backward_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected