-
Notifications
You must be signed in to change notification settings - Fork 724
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
映射文档 No. 87 #6051
映射文档 No. 87 #6051
Conversation
paddle.Tensor.lstsq(y, rcond=None, driver=None, name=None) | ||
``` | ||
|
||
两者功能一致,仅参数名不一致,具体如下: |
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参数更多
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.
已修改
@@ -0,0 +1,23 @@ | |||
## [ 仅 paddle 参数更多 ]torch.linalg.lstsq |
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.
已修改
@@ -0,0 +1,23 @@ | |||
## [ 仅 paddle 参数更多 ]torch.linalg.lstsq | |||
|
|||
### [torch.Tensor.lstsq](https://pytorch.org/docs/1.9.0/generated/torch.Tensor.lstsq.html?highlight=torch%20tensor%20lstsq#torch.Tensor.lstsq) |
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.
已修改
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.Tensor.lstsq]() | ||
|
||
```python | ||
paddle.Tensor.lstsq(y, rcond=None, driver=None, name=None) |
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.
这里是不是有些差异,可以运行下代码看下,torch.lstsq 的A在第二个位置,B在第一个位置,paddle的lstsq是相反的
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.
已修改,参数是相反,转换规则 PR PaddlePaddle/PaConvert#219
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------- | ------------ | --------------------------------------------------------------------------- | | ||
| A | y | 表示输入的 Tensor ,PyTorch 和 Paddle 参数相反,需要转写。 | |
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.
这个写法可以参考下其他的linalg api,比如triangular_solve、solve等api有没有这种 强调 调用关系相反的 话术
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.
已修改
| ------- | ------------ | --------------------------------------------------------------------------- | | ||
| A | y | 表示输入的 Tensor ,PyTorch 和 Paddle 参数相反,需要转写。 | | ||
| - | rcond | 用来决定 x 有效秩的 float 型浮点数。PyTorch 无此参数,Paddle 保持默认即可。 | | ||
| - | driver | 用来指定计算使用的 LAPACK 库方法。PyTorch 无此参数,Paddle 保持默认即可。 | |
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.
已修改分类,增加返回值行
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,看来只有第一个返回值能对上,这两个API的差异挺大
PaddlePaddle/PaConvert#112
87 torch.Tensor.lstsq torch 历史版本 1.9.0 支持 ,paddle无文档和关联代码行,paddle代码中对应paddle.linalg.lstsq