shingjan commented on a change in pull request #9432:
URL: https://github.com/apache/tvm/pull/9432#discussion_r742308542



##########
File path: python/tvm/script/tir/__init__.pyi
##########
@@ -0,0 +1,239 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=redefined-builtin
+from typing import (
+    Any,
+    Callable,
+    ContextManager,
+    Dict,
+    Iterable,
+    Object,
+    Optional,
+    Tuple,
+    Union,
+    Sequence,
+    List,
+    Mapping,
+)
+from tvm.tir.function import PrimFunc
+from tvm.tir import PrimExpr, Buffer, IterVar, Var
+from .node import BufferSlice
+
+"""
+Variables and constants
+"""
+
+def bool(imm: int) -> PrimExpr: ...

Review comment:
       the definition of `bool` here actually shadows all use of native `bool` 
type annotation of Python in this file. My workaround is to not include type 
annotation for method/class parameter that may be typed `bool`. E.g. this line 
would just be `def bool(imm) -> PrimExpr: ...`
   
   

##########
File path: python/tvm/script/tir/__init__.pyi
##########
@@ -0,0 +1,239 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=redefined-builtin
+from typing import (
+    Any,
+    Callable,
+    ContextManager,
+    Dict,
+    Iterable,
+    Object,
+    Optional,
+    Tuple,
+    Union,
+    Sequence,
+    List,
+    Mapping,
+)
+from tvm.tir.function import PrimFunc
+from tvm.tir import PrimExpr, Buffer, IterVar, Var
+from .node import BufferSlice
+
+"""
+Variables and constants
+"""
+
+def bool(imm: int) -> PrimExpr: ...
+def int8(imm: int) -> PrimExpr: ...

Review comment:
       done

##########
File path: python/tvm/script/tir/__init__.pyi
##########
@@ -0,0 +1,239 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=redefined-builtin
+from typing import (
+    Any,
+    Callable,
+    ContextManager,
+    Dict,
+    Iterable,
+    Object,
+    Optional,
+    Tuple,
+    Union,
+    Sequence,
+    List,
+    Mapping,
+)
+from tvm.tir.function import PrimFunc
+from tvm.tir import PrimExpr, Buffer, IterVar, Var
+from .node import BufferSlice
+
+"""
+Variables and constants
+"""
+
+def bool(imm: int) -> PrimExpr: ...
+def int8(imm: int) -> PrimExpr: ...
+def int16(imm: int) -> PrimExpr: ...
+def int32(imm: int) -> PrimExpr: ...
+def int64(imm: int) -> PrimExpr: ...
+def uint8(imm: int) -> PrimExpr: ...
+def uint16(imm: int) -> PrimExpr: ...
+def uint32(imm: int) -> PrimExpr: ...
+def uint64(imm: int) -> PrimExpr: ...
+def float8(imm: int) -> PrimExpr: ...
+def float16(imm: int) -> PrimExpr: ...
+def float32(imm: int) -> PrimExpr: ...
+def float64(imm: int) -> PrimExpr: ...
+
+"""
+Intrinsic
+"""
+
+def min_value(dtype): ...
+def max_value(dtype): ...
+def floordiv(x: PrimExpr, y: PrimExpr): ...
+def floormod(x: PrimExpr, y: PrimExpr): ...
+def abs(x): ...
+def load(dtype, var, index, predicate=None): ...
+def cast(value, dtype): ...
+def ramp(base, stride, lanes): ...
+def broadcast(value, lanes): ...
+def iter_var(var, dom, iter_type, thread_tag): ...
+def max(a, b): ...
+def min(a, b): ...
+def get_axis(begin, end, iter_type): ...
+def range(begin, end): ...

Review comment:
       removed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to