MCPcopy Create free account
hub / github.com/LuChengTHU/dpm-solver / _do_parallel_data_prefetch

Function _do_parallel_data_prefetch

examples/stable-diffusion/ldm/util.py:96–105  ·  view source on GitHub ↗
(func, Q, data, idx, idx_to_fn=False)

Source from the content-addressed store, hash-verified

94
95
96def _do_parallel_data_prefetch(func, Q, data, idx, idx_to_fn=False):
97 # create dummy dataset instance
98
99 # run prefetching
100 if idx_to_fn:
101 res = func(data, worker_id=idx)
102 else:
103 res = func(data)
104 Q.put([idx, res])
105 Q.put("Done")
106
107
108def parallel_data_prefetch(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected