-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Relay] GetItem #1861
[Relay] GetItem #1861
Conversation
@junrushao1994 @srkreddy1238 @masahi please review. |
include/tvm/relay/expr.h
Outdated
/*! \brief The tuple */ | ||
Expr tuple; | ||
/*! \brief which value to get */ | ||
size_t field; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to int index;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main reason is that usually if we want to serialize the model, the type should have fixed size across platform(int32, or int64). index is a more commonly used term
include/tvm/relay/expr.h
Outdated
@@ -378,6 +376,23 @@ class IfNode : public ExprNode { | |||
|
|||
RELAY_DEFINE_NODE_REF(If, IfNode, Expr); | |||
|
|||
/*! \brief Get a field out of a tuple. */ | |||
class GetItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetItem->TupleGetItem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@junrushao1994 thx for reviewing! |
GetItem is a relay construct for getting field out of a tuple