Fix zero shape bug for TensorArray

This commit is contained in:
xiaying 2021-10-14 14:59:14 +08:00
parent a469efe8ad
commit 7f50ae689d
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,9 @@ class TensorArrayComputer : public SizeComputer {
std::vector<int> elemShape(param->element_shape()->size());
for (int i = 0; i < param->element_shape()->size(); i++) {
elemShape[i] = param->element_shape()->Get(i);
if (elemShape[i] < 0) {
elemShape[i] = 0;
}
}
des->tensorArrayAttr->elemShape.emplace_back(std::move(elemShape));
}