ml_switcheroo.compiler.backends =============================== .. py:module:: ml_switcheroo.compiler.backends .. autoapi-nested-parse:: Compiler Backends Package. Contains concrete implementations of the ``CompilerBackend`` interface for specific target languages/formats (e.g., Python, RDNA, SASS). Submodules ---------- .. toctree:: :maxdepth: 1 /api/ml_switcheroo/compiler/backends/extras/index /api/ml_switcheroo/compiler/backends/python/index /api/ml_switcheroo/compiler/backends/python_snippet/index /api/ml_switcheroo/compiler/backends/rdna/index /api/ml_switcheroo/compiler/backends/sass/index Classes ------- .. autoapisummary:: ml_switcheroo.compiler.backends.PythonBackend Package Contents ---------------- .. py:class:: PythonBackend(framework: str = 'torch', semantics: Any = None) Bases: :py:obj:`ml_switcheroo.compiler.backend.CompilerBackend` Synthesizes a Python CST Module from a LogicalGraph. .. py:attribute:: framework :value: 'torch' .. py:method:: compile(graph: ml_switcheroo.compiler.ir.LogicalGraph) -> str Compiles the Logical Intermediate Representation (IR) into a target artifact. :param graph: The intermediate representation of the model structure. :type graph: LogicalGraph :returns: The compiled output (e.g., source code string, binary buffer, or AST). :rtype: Any .. py:method:: generate(graph: ml_switcheroo.compiler.ir.LogicalGraph, class_name: str = 'SwitcherooNet', original_tree: Optional[libcst.Module] = None) -> str