Skip to content

stages

EinsumEvaluator

Bases: Stage

Source code in src/finch/finch_einsum/stages.py
10
11
12
13
14
15
16
17
18
19
class EinsumEvaluator(Stage):
    @abstractmethod
    def lower(
        self,
        term: ein.EinsumNode,
        bindings: dict[ein.Alias, Any] | None = None,
    ):  # TODO eventually Any->Tensor
        """
        Evaluate the given logic.
        """

lower(term, bindings=None) abstractmethod

Evaluate the given logic.

Source code in src/finch/finch_einsum/stages.py
11
12
13
14
15
16
17
18
19
@abstractmethod
def lower(
    self,
    term: ein.EinsumNode,
    bindings: dict[ein.Alias, Any] | None = None,
):  # TODO eventually Any->Tensor
    """
    Evaluate the given logic.
    """

EinsumLoader

Bases: Stage

Source code in src/finch/finch_einsum/stages.py
22
23
24
25
26
27
28
29
class EinsumLoader(Stage):
    @abstractmethod
    def lower(self, term: ein.EinsumStatement, bindings: dict[ein.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(term, bindings) 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_einsum/stages.py
23
24
25
26
27
28
29
@abstractmethod
def lower(self, term: ein.EinsumStatement, bindings: dict[ein.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.
    """

EinsumTransform

Bases: Stage

Source code in src/finch/finch_einsum/stages.py
32
33
34
35
36
37
38
39
class EinsumTransform(Stage):
    @abstractmethod
    def lower(
        self, term: ein.EinsumStatement, bindings: dict[ein.Alias, TensorFType]
    ) -> tuple[ein.EinsumStatement, dict[ein.Alias, TensorFType]]:
        """
        Transform the given logic term into another logic term.
        """

lower(term, bindings) abstractmethod

Transform the given logic term into another logic term.

Source code in src/finch/finch_einsum/stages.py
33
34
35
36
37
38
39
@abstractmethod
def lower(
    self, term: ein.EinsumStatement, bindings: dict[ein.Alias, TensorFType]
) -> tuple[ein.EinsumStatement, dict[ein.Alias, TensorFType]]:
    """
    Transform the given logic term into another logic term.
    """