Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions loopy/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
Mapping,
Sequence,
Tuple,
TypeVar,
cast,
)

import immutables
Expand All @@ -49,7 +47,6 @@
import pymbolic.primitives as p
import pytools.lex
from islpy import dim_type
from pymbolic import ArithmeticExpressionT
from pymbolic.mapper import (
CachedCombineMapper as CombineMapperBase,
CachedIdentityMapper as IdentityMapperBase,
Expand Down Expand Up @@ -211,14 +208,8 @@ class FlattenMapper(FlattenMapperBase, IdentityMapperMixin):
pass


ArithmeticOrExpressionT = TypeVar(
"ArithmeticOrExpressionT",
ArithmeticExpressionT,
ExpressionT)


def flatten(expr: ArithmeticOrExpressionT) -> ArithmeticOrExpressionT:
return cast(ArithmeticOrExpressionT, FlattenMapper()(expr))
def flatten(expr):
return FlattenMapper()(expr)


class IdentityMapper(IdentityMapperBase, IdentityMapperMixin):
Expand Down