ml_switcheroo.core.mlir.generator ================================= .. py:module:: ml_switcheroo.core.mlir.generator .. autoapi-nested-parse:: MLIR to Python (LibCST) Generator. This module provides the `MlirToPythonGenerator` class, which consumes the MLIR CST object model and reconstructs valid Python code via LibCST. Classes ------- .. autoapisummary:: ml_switcheroo.core.mlir.generator.MlirToPythonGenerator Module Contents --------------- .. py:class:: MlirToPythonGenerator Bases: :py:obj:`ml_switcheroo.core.mlir.gen_expressions.ExpressionGeneratorMixin`, :py:obj:`ml_switcheroo.core.mlir.gen_statements.StatementGeneratorMixin`, :py:obj:`ml_switcheroo.core.mlir.gen_base.BaseGeneratorMixin` Transpiler back-end: MLIR CST -> Python LibCST. Integrates expression and statement generation logic. .. py:attribute:: ctx .. py:attribute:: usage_counts :type: Dict[str, int] .. py:attribute:: usage_consumers :type: Dict[str, ml_switcheroo.core.mlir.nodes.OperationNode] .. py:attribute:: deferred_exprs :type: Dict[str, libcst.BaseExpression] .. py:method:: generate(node: ml_switcheroo.core.mlir.nodes.ModuleNode) -> libcst.Module Main entry point. Converts MLIR Module to Python Module. :param node: The root MLIR ModuleNode. :returns: A LibCST Module object representing the Python code.