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

Method as_text

imperative/python/megengine/xla/compile.py:565–575  ·  view source on GitHub ↗
(self, dialect: Optional[str] = None)

Source from the content-addressed store, hash-verified

563 raise NotImplementedError("must override")
564
565 def as_text(self, dialect: Optional[str] = None) -> str:
566 if dialect is None:
567 dialect = "stablehlo"
568 if dialect == "mhlo":
569 return str(self.mhlo())
570 elif dialect == "stablehlo":
571 return str(self.stablehlo())
572 elif dialect == "hlo":
573 return self.hlo().as_hlo_text()
574 else:
575 raise ValueError(f"unknown dialect: {dialect}")
576
577 def compiler_ir(self, dialect: Optional[str] = None) -> Any:
578 if dialect is None:

Callers

nothing calls this directly

Calls 4

mhloMethod · 0.95
stablehloMethod · 0.95
hloMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected