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

Function tuple_insert

imperative/python/megengine/xla/utils.py:93–95  ·  view source on GitHub ↗
(t, idx, val)

Source from the content-addressed store, hash-verified

91
92# (a, b, c), 1, x -> (a, x, b, c)
93def tuple_insert(t, idx, val):
94 assert 0 <= idx <= len(t), (idx, len(t))
95 return t[:idx] + (val,) + t[idx:]

Callers 1

_pmap_sharding_specFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected