提交 4018754d 编写于 作者: W wanghaoshuang

fix LoDTensor::lod_element to get last element in level

上级 6a03a4d9
......@@ -78,7 +78,7 @@ class LoDTensor : public Tensor {
*/
size_t lod_element(size_t level, size_t elem) const {
PADDLE_ENFORCE_LT(level, NumLevels());
PADDLE_ENFORCE_LT(elem, NumElements(level));
PADDLE_ENFORCE_LE(elem, NumElements(level));
return (lod_)[level][elem];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册