Skip to content

Commit

Permalink
[UX] Make T.prim_func typecheck as staticmethod (#13980)
Browse files Browse the repository at this point in the history
This PR makes T.prim_func typecheck as static method to reduce
the set of warnings in tvmscript.
  • Loading branch information
tqchen authored Feb 14, 2023
1 parent 74b9720 commit c6ce283
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion python/tvm/script/parser/tir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@
# under the License.
"""The tir parser"""

from typing import TYPE_CHECKING

from ...ir_builder.tir import * # pylint: disable=redefined-builtin
from ...ir_builder.tir import ir as _tir
from . import operation as _operation
from . import parser as _parser
from .entry import Buffer, Ptr, prim_func
from .entry import Buffer, Ptr

if TYPE_CHECKING:
# pylint: disable=invalid-name
# Define prim_func and make it type check as static method
# so most tvmscript won't trigger pylint error here.
prim_func = staticmethod
else:
from .entry import prim_func

__all__ = _tir.__all__ + ["Buffer", "Ptr", "prim_func"]

0 comments on commit c6ce283

Please sign in to comment.