|
11 | 11 | import operator
|
12 | 12 | import textwrap
|
13 | 13 | from collections import Counter
|
14 |
| -from typing import Any, Callable, Generic, no_type_check, Optional, TYPE_CHECKING, Union |
| 14 | +from typing import Any, Callable, Generic, Optional, TYPE_CHECKING, Union |
15 | 15 | from typing_extensions import TypeVar
|
16 | 16 |
|
17 | 17 | import sympy
|
|
46 | 46 | from ..runtime.runtime_utils import green_text, yellow_text
|
47 | 47 | from ..scheduler import BaseSchedulerNode, BaseScheduling, WhyNoFuse
|
48 | 48 | from ..utils import (
|
49 |
| - cache_on_self, |
| 49 | + cache_property_on_self, |
50 | 50 | expr_fits_within_32bit,
|
51 | 51 | get_dtype_size,
|
52 | 52 | IndentedBuffer,
|
@@ -133,17 +133,15 @@ def __init__(
|
133 | 133 | self.root = root
|
134 | 134 |
|
135 | 135 | @property
|
136 |
| - @cache_on_self |
137 |
| - @no_type_check # https://github.com/python/mypy/issues/17184 |
| 136 | + @cache_property_on_self |
138 | 137 | def is_reduction(self) -> bool:
|
139 | 138 | return prefix_is_reduction(self.prefix)
|
140 | 139 |
|
141 | 140 | def symbol(self) -> sympy.Symbol:
|
142 | 141 | return sympy_index_symbol(self.name)
|
143 | 142 |
|
144 | 143 | @property
|
145 |
| - @cache_on_self |
146 |
| - @no_type_check |
| 144 | + @cache_property_on_self |
147 | 145 | def symt(self) -> SymT:
|
148 | 146 | prefix_to_symt = {prefix: symt for symt, prefix in prefix_str.items()}
|
149 | 147 | return prefix_to_symt[self.prefix]
|
@@ -430,8 +428,7 @@ def simplify_indexing(index: sympy.Expr):
|
430 | 428 | self.initialize_range_tree(pid_cache)
|
431 | 429 |
|
432 | 430 | @property
|
433 |
| - @cache_on_self |
434 |
| - @no_type_check # https://github.com/python/mypy/issues/17184 |
| 431 | + @cache_property_on_self |
435 | 432 | def num_reduction_dims(self) -> int:
|
436 | 433 | return sum(prefix_is_reduction(prefix) for prefix in self.numels)
|
437 | 434 |
|
|
0 commit comments