-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add python wrapper for gather op. #11033
Conversation
python/paddle/fluid/layers/nn.py
Outdated
|
||
Args: | ||
input (Variable): The source input with rank>1. | ||
index (Variable): The index input with rang=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.
rank?
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.
Thx. Fixed.
python/paddle/fluid/layers/nn.py
Outdated
**Gather Operator** | ||
|
||
Out is obtained by gathering entries of the outer-most dimension | ||
of X indexed by Index and concatenate them together. |
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.
- Out -> Output
Index -> `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.
Thx. Fixed.
python/paddle/fluid/layers/nn.py
Outdated
|
||
.. code-block:: text | ||
|
||
* Case 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.
还有其他Case吗?否则,就不要标Case了
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.
Thx. Fixed.
python/paddle/fluid/layers/nn.py
Outdated
index (Variable): The index input with rang=1. | ||
|
||
Returns: | ||
output (Variable): The output is a tensor with the same shape as input. |
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.
输出和输入shape并不相同。
python/paddle/fluid/layers/nn.py
Outdated
|
||
def gather(input, index): | ||
""" | ||
**Gather Operator** |
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.
In Python API, there should not be any operator
.
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.
Thx. Fixed.
python/paddle/fluid/layers/nn.py
Outdated
[5, 6]] | ||
|
||
Args: | ||
input (Variable): The source input with rank>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.
gather_op should work even if rank == 1
, please consider to modify it.
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.
Thx. The op support rank==1
already. I add a unitest for rank==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.
LGTM.
Add python wrapper for gather op.