MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / safe_zip

Function safe_zip

imperative/python/megengine/xla/utils.py:32–37  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

30
31# zip with args length check
32def safe_zip(*args):
33 args = list(map(list, args))
34 n = len(args[0])
35 for arg in args[1:]:
36 assert len(arg) == n, f"length mismatch: {list(map(len, args))}"
37 return list(zip(*args))
38
39
40# ((x, a), (y, b), (z, c)) -> (x, y, z), (a, b, c)

Callers 6

devices_indices_mapMethod · 0.85
device_putFunction · 0.85
__call__Method · 0.85
from_hloMethod · 0.85
build_execute_funMethod · 0.85

Calls 1

listFunction · 0.85

Tested by

no test coverage detected