Skip to content

Commit 4e8527d

Browse files
committed
remove uneccesary function
Change-Id: Ifc1b4c34cd891fce35d3e043ba81afdd2e34fc4e
1 parent cf3b8da commit 4e8527d

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

python/tvm/relay/backend/contrib/ethosu/codegen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from tvm.relay.backend.contrib.ethosu import tir_to_cs_translator
2626
from tvm.relay.backend.contrib.ethosu import util
2727
from tvm.relay.backend.contrib.ethosu import op as ethosu_op
28-
from tvm.relay.backend.contrib.ethosu.util import is_ethosu_op
2928
from tvm.relay.expr_functor import ExprMutator
3029
from tvm.relay.backend.contrib.ethosu.op import op_attrs # pylint: disable=unused-import
3130

@@ -168,7 +167,7 @@ def visit_call(self, call: tvm.relay.expr.Call) -> tvm.relay.expr.Call:
168167
not refer to an Op. Else, a new call node with altered Op
169168
attributes.
170169
"""
171-
if is_ethosu_op(call) and call.op.name != "contrib.ethosu.identity":
170+
if isinstance(call.op, tvm.ir.op.Op) and call.op.name in self.optimize_op:
172171
return self.alter_ethosu_op_layout(call)
173172
return super().visit_call(call)
174173

python/tvm/relay/backend/contrib/ethosu/util.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,6 @@ def is_composite_func(func: relay.Function, name: str) -> bool:
139139
return composite_name == name
140140

141141

142-
def is_ethosu_op(expr: tvm.relay.Expr) -> bool:
143-
"""Checks whether a relay expression is an NPU operator or not.
144-
145-
Parameters
146-
----------
147-
expr : tvm.relay.Expr
148-
The expression to check.
149-
150-
Returns
151-
-------
152-
bool
153-
True if the expression is an EthosU operation, false if not.
154-
"""
155-
return (
156-
isinstance(expr, tvm.relay.expr.Call)
157-
and isinstance(expr.op, tvm.ir.op.Op)
158-
and "contrib.ethosu" in expr.op.name
159-
)
160-
161-
162142
def get_range_for_dtype_str(dtype: str) -> Tuple[int, int]:
163143
"""
164144
Produce the min,max for a give data type.

0 commit comments

Comments
 (0)