MCPcopy Create free account
hub / github.com/XL2248/MSCTD / _maybe_repeat

Function _maybe_repeat

src_code/thumt1_code/thumt/utils/parallel.py:14–19  ·  view source on GitHub ↗
(x, n)

Source from the content-addressed store, hash-verified

12
13
14def _maybe_repeat(x, n):
15 if isinstance(x, list):
16 assert len(x) == n
17 return x
18 else:
19 return [x] * n
20
21
22# Data-level parallelism

Callers 1

data_parallelismFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected