Skip to content

Commit

Permalink
[Relay] Check if the attribute "name" exists before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaLancellotti authored and root committed Apr 4, 2023
1 parent f5db8b7 commit c341e1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/qnn/op/_qnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def legalize_clip(attrs, inputs, tinfos):
implementations (like Cortex-M) need it to be done earlier in legalization.
"""

if hasattr(inputs[0], "op") and inputs[0].op.name == "qnn.requantize":
if hasattr(inputs[0], "op") and hasattr(inputs[0].op, "name") and inputs[0].op.name == "qnn.requantize":
dtype_info = np.iinfo(tinfos[0].dtype)
if dtype_info.min == attrs.a_min and dtype_info.max == attrs.a_max:
return inputs[0]
Expand Down

0 comments on commit c341e1a

Please sign in to comment.