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

add lod tensor interface design #3454

Closed
wants to merge 2 commits into from

Conversation

Superjomn
Copy link
Contributor

No description provided.


- 基本设计完全按照8-11(上周五)讨论的方案,只有如下变化
- 由于目前只有2种tensor,难以确保将来是否有其他类似 `LOD` 角色的Tensor,因此本设计不会将 `LODTensor` 直接作为 Interface,而是将最基础的Tensor概念作为Interface
- 目前实现的Tensor会更名为 `DenseTensor`
Copy link
Collaborator

Choose a reason for hiding this comment

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

目前不需要把Tensor改成DenseTensor吧。我理解只需要约定所有需要用到Tensor的地方都用LODTensor即可?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

了解,那我把 Tensor 全局替换成 LODTensor 应该就可以了

- 更复杂的类型问题,将推迟到有了2个以上Tensor 类型的时候考虑

## Tensor 作为Interface
`Tensor interface` 直接对应其他平台的相同概念,但LODTensor无法; 稠密的为 DenseTensor,稀疏的为 SparseTensor。
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个提取interface的工作也是几个月之后才会需要做的吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

但暂时,LODTensor 只有在变长RNN的时候才开始用到,暂时只是定长RNN,这个阶段所有的Op都只需要Tensor。

这个替换是临时解决方案,是否hold到变长RNN的时候再全局替换(应该也在小demo,RNN定长demo两个阶段之后了)。

理解的是,如果是通用解决方案,可以现在合入,如果临时解决方案,就等到需要的时候合入?

Copy link
Collaborator

Choose a reason for hiding this comment

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

好。那就等需要边长RNN的时候再替换吧!

### 所有的InferShape里在最开始添加var 的Clone,以实现类型传递

```c++
T* VarClone(const Variable& var){
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果现在只有LODTensor在实际使用,是不是也就不需要clone了?

@wangkuiyi wangkuiyi mentioned this pull request Aug 29, 2017
@Superjomn Superjomn closed this May 12, 2018
@Superjomn Superjomn reopened this May 12, 2018
@Superjomn Superjomn closed this May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants