Skip to content
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.214 torch.linalg.tensorinv #6059

Closed

Conversation

RedContritio
Copy link
Contributor

torch.linalg.tensorinv 特点:

  • 无对应 API,映射到 paddle.linalg.inv 以组合替代实现。



```python
# PyTorch 写法:
Copy link
Collaborator

@zhwesky2010 zhwesky2010 Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个转写示例过于复杂了,需要写成简单的 映射关系,让人一眼能看明白大致思路来参考即可,伪代码形式也可以

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新

A_ = paddle.reshape(A, [A_dim_0, A_dim_1])
A_inv_ = paddle.linalg.inv(A_)

A_inv = paddle.reshape(A_inv_, A.shape[ind:] + A.shape[:ind])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个返回结果的shape,我试了下和torch好像对不上,麻烦对比一下这两个Tensor的计算结果值

@luotao1
Copy link
Collaborator

luotao1 commented Aug 18, 2023

@RedContritio 别忘了这个PR哈

@zhwesky2010
Copy link
Collaborator

zhwesky2010 commented Sep 7, 2023

这个api的与当前的split功能差异较大,组合也较为繁琐,计划后面新增API,因此先按功能缺失来吧,等API开发完成后直接映射到 paddle.tensorinv 就可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants