Skip to content

stages

LogicEvaluator

Bases: Stage

Source code in src/finch/finch_logic/stages.py
class LogicEvaluator(Stage):
    @abstractmethod
    def lower(
        self, prgm: lgc.LogicNode, bindings: dict[lgc.Alias, Tensor] | None = None
    ):
        """
        Evaluate the given logic.
        """

lower(prgm, bindings=None) abstractmethod

Evaluate the given logic.

Source code in src/finch/finch_logic/stages.py
@abstractmethod
def lower(
    self, prgm: lgc.LogicNode, bindings: dict[lgc.Alias, Tensor] | None = None
):
    """
    Evaluate the given logic.
    """

LogicLoader

Bases: Stage

Source code in src/finch/finch_logic/stages.py
class LogicLoader(Stage):
    @abstractmethod
    def lower(
        self,
        prgm: lgc.LogicStatement,
        bindings: dict[lgc.Alias, TensorFType],
        stats: dict[lgc.Alias, TensorStats],
        stats_factory: StatsFactory,
    ) -> tuple[
        AssemblyLibrary,
        dict[lgc.Alias, TensorFType],
    ]:
        """
        Generate Finch Library from the given logic and input types, with a
        single method called `main` which implements the logic. Also return a
        dictionary including additional tables needed to run the kernel.
        """

lower(prgm, bindings, stats, stats_factory) abstractmethod

Generate Finch Library from the given logic and input types, with a single method called main which implements the logic. Also return a dictionary including additional tables needed to run the kernel.

Source code in src/finch/finch_logic/stages.py
@abstractmethod
def lower(
    self,
    prgm: lgc.LogicStatement,
    bindings: dict[lgc.Alias, TensorFType],
    stats: dict[lgc.Alias, TensorStats],
    stats_factory: StatsFactory,
) -> tuple[
    AssemblyLibrary,
    dict[lgc.Alias, TensorFType],
]:
    """
    Generate Finch Library from the given logic and input types, with a
    single method called `main` which implements the logic. Also return a
    dictionary including additional tables needed to run the kernel.
    """