tlc-pack / relax

Apache License 2.0
193 stars 58 forks source link

[Fix][Util] Type comparison in auto arg converter #394

Closed MasterJH5574 closed 1 year ago

MasterJH5574 commented 1 year ago

Previously when running all relax unit tests on my machine using pytest test_*, one auto argument converter tests always fail. (And when I only run that single test, it passes very well.)

After inspection, I noted that in the failed test, though anno is printed as typing.Optional[tvm.ir.expr.RelayExpr], the comparison below anno is Optional[Expr] still results false. https://github.com/tlc-pack/relax/blob/2e5e47962238be7385486241203d1a8146f38a0e/python/tvm/relax/utils.py#L252-L253

I tweaked the comparison to in and all tests seem to pass very successfully. I guess the issue might relate to some address issue (?) but I’m not 100% sure about this.

cc @Hzfengsy