gemini-code-assist[bot] commented on code in PR #20032:
URL: https://github.com/apache/tvm/pull/20032#discussion_r3610559512
##########
tests/python/relax/test_expr.py:
##########
@@ -243,11 +243,16 @@ def test_func():
seqe = rx.SeqExpr(blocks, x)
ret_ty = R.Tensor(dtype="float32", ndim=-1)
func = rx.Function([x], seqe, ret_ty)
- func = func.with_attr("global_symbol", "func")
- assert func.params[0] == x
- assert func.body == seqe
- assert func.ret_ty == ret_ty
- assert func.attrs["global_symbol"] == "func"
+ with_attr = func.with_attr("global_symbol", "func")
+ with_attrs = func.with_attr({"global_symbol": "func", "num_input": 1})
+
+ assert "global_symbol" not in func.attrs
Review Comment:

If func is created without any attributes, func.attrs may be None (a null
DictAttrs mapping to None in Python). Attempting to perform a membership test
like 'global_symbol' not in func.attrs on None will raise a TypeError. Since
the function is newly created and expected to have no attributes, it is safer
and more robust to assert that func.attrs is None directly.
```suggestion
assert func.attrs is None
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]