Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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)
93
def
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_spec
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected