Skip to content

Commit 2218102

Browse files
committed
Checking that tvm.relay.expr.Call.op exists
1 parent 46b4602 commit 2218102

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ def visit_call(self, call: tvm.relay.expr.Call) -> tvm.relay.expr.Call:
9090
new_call = call
9191
lut_activations = ["TANH", "LUT"]
9292

93-
if (
94-
call.op.name == "contrib.ethosu.identity"
95-
and call.attrs.activation in lut_activations
96-
and isinstance(call.args[0], tvm.relay.expr.Call)
97-
):
93+
if isinstance(call.op, tvm.ir.Op) and isinstance(call.args[0], tvm.relay.expr.Call):
9894
producer_op = call.args[0]
9995
# Check if the producer can do a LUT operation
100-
if producer_op.op.name in self.lut_ops.keys():
96+
if (
97+
producer_op.op.name in self.lut_ops.keys()
98+
and call.op.name == "contrib.ethosu.identity"
99+
and call.attrs.activation in lut_activations
100+
):
101101
# Check the producer doesn't already have a LUT
102102
has_lut = producer_op.attrs.activation in lut_activations
103103
if not has_lut:

python/tvm/relay/backend/contrib/ethosu/op/op_attrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
"""The attributes node used for EthosU Relay operators."""
17+
"""The attributes node used for Arm(R) Ethos(TM)-U NPU Relay operators."""
1818
from tvm.ir import Attrs
1919
import tvm._ffi
2020

0 commit comments

Comments
 (0)