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

Function ir_constant_tuple

imperative/python/megengine/xla/ir_utils.py:388–395  ·  view source on GitHub ↗
(val: Any, canonicalize_types: bool = True)

Source from the content-addressed store, hash-verified

386
387
388def ir_constant_tuple(val: Any, canonicalize_types: bool = True) -> Sequence[ir.Value]:
389 for t in type(val).__mro__:
390 handler = _constant_handlers.get(t)
391 if handler:
392 out = handler(val, canonicalize_types)
393 assert all(isinstance(v, ir.Value) for v in out), (type(val), out)
394 return out
395 assert False
396
397
398def ir_constant(val: Any, canonicalize_types: bool = True) -> Sequence[ir.Value]:

Callers 2

ir_constantFunction · 0.85
dummy_tokenFunction · 0.85

Calls 2

handlerFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected