-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Implement the type of data in channel #8285
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,14 @@ message LoDTensorArrayDesc { | |
|
||
message ReaderDesc { repeated LoDTensorDesc lod_tensor = 1; } | ||
|
||
message ChanEleDesc { repeated VarDesc meta_data = 1; } | ||
|
||
message ChanDesc { | ||
repeated ChanEleDesc channel_type = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think message ChanDesc {
required VarType ele_type = 1;
required int32 cap = 2 [ default = 0 ];
required string name = 3;
} Then The contents of the channel are manipulated at runtime. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @typhoonzero thanks for your review! And this is a good suggestion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all the work to do in this PR is to add the following definition of message ChannelDesc {
VarDesc elem_type = 1;
int cap = 2;
} Nothing more than that. |
||
required int32 cap = 2 [ default = 0 ]; | ||
required string name = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why would we need A reference design is the Go's channel definition: https://github.com/golang/go/blob/4fc9565ffce91c4299903f7c17a275f0786734a1/src/runtime/chan.go#L17-L29 We are particularly interested in |
||
} | ||
|
||
message VarDesc { | ||
enum VarType { | ||
LOD_TENSOR = 1; | ||
|
@@ -129,6 +137,7 @@ message VarDesc { | |
LOD_TENSOR_ARRAY = 7; | ||
PLACE_LIST = 8; | ||
READER = 9; | ||
CHAN = 10; | ||
} | ||
required string name = 1; | ||
required VarType type = 2; | ||
|
@@ -137,6 +146,7 @@ message VarDesc { | |
optional TensorDesc selected_rows = 5; | ||
optional LoDTensorArrayDesc tensor_array = 6; | ||
optional ReaderDesc reader = 7; | ||
optional ChanDesc chan = 8; | ||
} | ||
|
||
message BlockDesc { | ||
|
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.
Could you also explain why
ChanEleDesc
is repeated here? From what I understand, the types of each of the dimensions in then-tuple
is captured by the statementrepeated MetaDataDesc meta_data
. Are we trying to make a tuple of tuples here? Sorry about the confusion.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.
I know what you mean, let me think again.