CharlieFRuan commented on code in PR #16284: URL: https://github.com/apache/tvm/pull/16284#discussion_r1444750422
########## python/tvm/relax/frontend/nn/core.py: ########## @@ -67,6 +67,8 @@ _DEFAULT_DTYPE = "float32" +# If a shape is specified as a string `name`, we create a `tvm.tir.Var(name, "int64")` +ShapeVar = Union[int, str, tir.PrimExpr] Review Comment: Would `ShapeInputType` be better, with a more detailed documentation above it? I am worried that if more `nn.Module` are going to have dynamic shapes in `python/tvm/relax/frontend/nn/modules.py`, `Union[int, str, tir.PrimExpr]` would be repeated in too many places... Right now it is only `Embedding` and `Linear`. ########## python/tvm/relax/frontend/nn/core.py: ########## @@ -67,6 +67,8 @@ _DEFAULT_DTYPE = "float32" +# If a shape is specified as a string `name`, we create a `tvm.tir.Var(name, "int64")` +ShapeVar = Union[int, str, tir.PrimExpr] Review Comment: Would `ShapeInputType` be better, with a more detailed comment above it? I am worried that if more `nn.Module` are going to have dynamic shapes in `python/tvm/relax/frontend/nn/modules.py`, `Union[int, str, tir.PrimExpr]` would be repeated in too many places... Right now it is only `Embedding` and `Linear`. -- 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]
