-
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
Update comments for two operators. #7457
Conversation
lcy-seso
commented
Jan 11, 2018
•
edited
Loading
edited
- Codes of reorder_lod_tansor_by_rank_op have been updated but its comments has not been updated yet.
- Fix the display format of the shrink_rnn_memory_op and update the comments.
a2be67c
to
c381560
Compare
c381560
to
473fd63
Compare
X = [Seq0, Seq1, Seq2, Seq3]. The indices in RankTable are [3, 0, 2, 1]. | ||
Out = [Seq3, Seq0, Seq2, Seq1] with a new LoD information. | ||
|
||
If the LoD information of Input(X) is empty, this means Input(X) is not a |
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.
not a sequence
may not be proper. Something like not sequence data
might be better.
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.
Done.
@@ -687,11 +687,10 @@ def topk(input, k): | |||
|
|||
|
|||
def lod_tensor_to_array(x, table): | |||
"""This function performs the operation that converts an LOD_Tensor to | |||
an array. | |||
""" Convert a LOD_TENSOR_ARRAY to an TensorArray. |
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.
Should it be LOD_TENSOR_ARRAY
or LoDTensor
here
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.
Done. thank you.
|
||
Args: | ||
x (Variable|list): The array that needs to be converted to a tensor. | ||
x (Variable|list): The LoD Tensor Array to be converted to a tensor. |
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.
Should converted to a tensor
be converted to a LoDTensor
here
Returns: | ||
Variable: The tensor type variable that has the data written to it. | ||
Variable: The ouput LOD_TENSOR_ARRAY where the input tensor is written. |
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 ouput
should be The output
.
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.
Done.
|
||
The Out = [Seq3, Seq0, Seq2, Seq1] with correct LoD information. | ||
If the indices stored in the Input(RankTable) is [3, 0, 2, 1], the |
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.
is -> are
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.
Done.
|
||
The Out = [Seq3, Seq0, Seq2, Seq1] with correct LoD information. | ||
If the indices stored in the Input(RankTable) is [3, 0, 2, 1], the | ||
Input(X) will be reordered that the forth sequence in Input(X) will become the |
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.
forth -> fourth
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.
There is some language polishing needed. Apart from that everything looks good. Thank you for the PR!
The Out = [Seq3, Seq0, Seq2, Seq1] with correct LoD information. | ||
If the indices stored in the Input(RankTable) is [3, 0, 2, 1], the | ||
Input(X) will be reordered that the forth sequence in Input(X) will become the | ||
first one, and then followed by the originally first, third, and the second one. |
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.
originally -> original
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.
Done.
Out = [Seq3, Seq0, Seq2, Seq1] with a new LoD information. | ||
|
||
If the LoD information of Input(X) is empty, this means Input(X) is not a | ||
sequcence. This is also identical to a batch of sequences each sequence in which |
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 sentence should be -> This is also identical to a batch of sequences where each sequence has a fixed length 1.
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.
Done.
indices in RankTable are [3, 0, 2, 1]. | ||
Out = [Slice3, Slice0, Slice2, Slice1] with no LoD information is appended. | ||
|
||
NOTE: This operator sorts Input(X) according to a given LoDRankTable which dose |
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.
dose -> does
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.
Done.
|
||
Args: | ||
x (Variable|list): The tensor that needs to be converted to an array. | ||
x (Variable|list): The lod tensor to be converted to a lod tensor array. |
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.
lod -> LOD
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.
Done.
@@ -146,25 +146,27 @@ def fill_constant(shape, dtype, value, out=None): | |||
""" | |||
**fill_constant** | |||
|
|||
This function creates a tensor of specified *shape* and | |||
*dtype*, and initializes this with a constant supplied in *value*. | |||
This function creates a tensor with the specified `shape` and |
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.
You can drop the
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.
Done.
This function creates a tensor of specified *shape* and | ||
*dtype*, and initializes this with a constant supplied in *value*. | ||
This function creates a tensor with the specified `shape` and | ||
`dtype`, and initializes it with the constant specifed by `value`. |
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 -> a
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.
Done.
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.
follow comments. Thanks for all the corrections.
@@ -146,25 +146,27 @@ def fill_constant(shape, dtype, value, out=None): | |||
""" | |||
**fill_constant** | |||
|
|||
This function creates a tensor of specified *shape* and | |||
*dtype*, and initializes this with a constant supplied in *value*. | |||
This function creates a tensor with the specified `shape` and |
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.
Done.
|
||
The Out = [Seq3, Seq0, Seq2, Seq1] with correct LoD information. | ||
If the indices stored in the Input(RankTable) is [3, 0, 2, 1], the |
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.
Done.
The Out = [Seq3, Seq0, Seq2, Seq1] with correct LoD information. | ||
If the indices stored in the Input(RankTable) is [3, 0, 2, 1], the | ||
Input(X) will be reordered that the forth sequence in Input(X) will become the | ||
first one, and then followed by the originally first, third, and the second one. |
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.
Done.
X = [Seq0, Seq1, Seq2, Seq3]. The indices in RankTable are [3, 0, 2, 1]. | ||
Out = [Seq3, Seq0, Seq2, Seq1] with a new LoD information. | ||
|
||
If the LoD information of Input(X) is empty, this means Input(X) is not a |
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.
Done.
Out = [Seq3, Seq0, Seq2, Seq1] with a new LoD information. | ||
|
||
If the LoD information of Input(X) is empty, this means Input(X) is not a | ||
sequcence. This is also identical to a batch of sequences each sequence in which |
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.
Done.
indices in RankTable are [3, 0, 2, 1]. | ||
Out = [Slice3, Slice0, Slice2, Slice1] with no LoD information is appended. | ||
|
||
NOTE: This operator sorts Input(X) according to a given LoDRankTable which dose |
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.
Done.
@@ -687,11 +687,10 @@ def topk(input, k): | |||
|
|||
|
|||
def lod_tensor_to_array(x, table): | |||
"""This function performs the operation that converts an LOD_Tensor to | |||
an array. | |||
""" Convert a LOD_TENSOR_ARRAY to an TensorArray. |
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.
Done. thank you.
|
||
Args: | ||
x (Variable|list): The tensor that needs to be converted to an array. | ||
x (Variable|list): The lod tensor to be converted to a lod tensor array. |
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.
Done.
Returns: | ||
Variable: The tensor type variable that has the data written to it. | ||
Variable: The ouput LOD_TENSOR_ARRAY where the input tensor is written. |
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.
Done.
This function creates a tensor of specified *shape* and | ||
*dtype*, and initializes this with a constant supplied in *value*. | ||
This function creates a tensor with the specified `shape` and | ||
`dtype`, and initializes it with the constant specifed by `value`. |
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.
Done.