Skip to content

Commit 2b621c9

Browse files
committed
remove linting with Self; it is not supported in pytho 3.10
1 parent deef6fe commit 2b621c9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

test/benchgc/src/benchgc/arg/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
import argparse
1818
import torch
1919
import numpy
20-
from typing import List, Self, Tuple, Callable
20+
from typing import List, Tuple, Callable
21+
# only python 3.11 support
22+
# from typing import Self
2123
import benchgc.util
2224
import importlib
2325
import gc_mlir.ir
@@ -89,7 +91,9 @@ def get_empty_op(self, ctx: gc_mlir.ir.Context) -> gc_mlir.dialects.tensor.Empty
8991
return gc_mlir.dialects.tensor.EmptyOp(self.shape, self.get_mlir_dtype(ctx))
9092

9193
def set_default_fill_param(
92-
self, flags: argparse.Namespace, argin: List[Self], argout: List[Self]
94+
self, flags: argparse.Namespace,
95+
argin, # List[Self]
96+
argout, # List[Self]
9397
):
9498

9599
if self.shape == [] or self.dtype == "" or self.type == "":
@@ -159,7 +163,9 @@ def set_default_fill_param(
159163
self.param.extend(["-1", "0"])
160164

161165
def set_default_compare_param(
162-
self, flags: argparse.Namespace, argin: List[Self], argout: List[Self]
166+
self, flags: argparse.Namespace,
167+
argin, # List[Self],
168+
argout, # List[Self]
163169
):
164170
if self.shape == [] or self.dtype == "" or self.type == "":
165171
raise Exception(

test/benchgc/src/benchgc/mlir.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
from gc_mlir.dialects import func
2020

2121
from benchgc.arg import Arg
22-
from typing import Callable, List, Self
22+
from typing import Callable, List
23+
24+
# only python 3.11 support
25+
# from typing import Self
2326

2427

2528
def get_entry_args(module: gc_mlir.ir.Module, entry: str = '"entry"') -> List[str]:
@@ -99,7 +102,7 @@ class MLIRCache:
99102
# argument name cache
100103
arg: List[str]
101104
# next hierarchy
102-
next: List[Self]
105+
next = [] # List[Self]
103106

104107
def __init__(self):
105108
self.opr = []

0 commit comments

Comments
 (0)