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

Difference between NumElements and offset of LoDTensor #4181

Closed
wanghaoshuang opened this issue Sep 19, 2017 · 2 comments
Closed

Difference between NumElements and offset of LoDTensor #4181

wanghaoshuang opened this issue Sep 19, 2017 · 2 comments

Comments

@wanghaoshuang
Copy link
Contributor

wanghaoshuang commented Sep 19, 2017

LoDTensor::NumElements()返回的是指定level的最后一个elementoffset, 但是名字看起来像求指定level element数量。
而且,LoDTensor::NumLevels()确实是返回level的数量,是命名没统一,还是我对LoDTensor::lod_存储内容理解有误?

@QiJune
Copy link
Member

QiJune commented Sep 19, 2017

NumElements(size_t level) 返回的是指定层级上的offset的个数
NumLevels() 返回的是sequence的层级有几个

@wanghaoshuang
Copy link
Contributor Author

wanghaoshuang commented Sep 19, 2017

明白了,是我对LoDTensor::lod_存储内容理解有误。
#3746 (comment)

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

No branches or pull requests

2 participants