-
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 gpu kernel for new api : linalg.lstsq #38621
Add gpu kernel for new api : linalg.lstsq #38621
Conversation
Thanks for your contribution! |
python/paddle/tensor/linalg.py
Outdated
should be one of float32, float64. | ||
y (Tensor): A tensor with shape ``(*, M, K)`` , the data type of the input Tensor ``y`` | ||
should be one of float32, float64. | ||
rcond(float, optional): A float pointing number used to determine the effective rank of ``x``. |
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 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.
已加
python/paddle/tensor/linalg.py
Outdated
.. code-block:: python | ||
|
||
import paddle | ||
import numpy as np |
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 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.
已删
paddle/fluid/operators/lstsq_op.cu
Outdated
auto tmp_x = dito.Transpose(new_x); | ||
auto tmp_y = dito.Transpose(new_y); | ||
framework::TensorCopy(tmp_x, new_x.place(), &new_x); | ||
framework::TensorCopy(tmp_y, new_y.place(), &new_y); |
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.
Why need this copy?
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.
Thank you for comments. It's not necessary so I removed it.
paddle/fluid/operators/lstsq_op.cu
Outdated
auto slice_b = dito.Slice(trans_b, {-2}, {0}, {min_mn}); | ||
auto tmp_r = dito.TrilTriu(slice_r, 0, false); | ||
framework::TensorCopy(tmp_r, new_x.place(), &new_x); | ||
framework::TensorCopy(slice_b, new_y.place(), &new_y); |
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.
same as above
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.
Thank you for comments. It's not necessary so I removed 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.
LGTM for API docs
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
PR types
Function optimization
PR changes
OPs
Describe
Add gpu kernel for new api : linalg.lstsq
You can see the implementation of cpu kernel in PR38585
The docs_cn of paddle.linalg.lstsq is merged by docs-PR4174
1、usage example:
2、docs_cn:
3、docs_en: