Skip to content

Commit

Permalink
check for dynamic rank before accessing value (apache#7414)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Brookhart authored and trevor-m committed Mar 2, 2021
1 parent 7023e8f commit 3eb9062
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/relay/op/dyn/tensor/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ bool ReshapeRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
return false;
}

// Doesn't support dynamic output rank
for (int i = 0; i < newshape->shape[0].as<IntImmNode>()->value; i++) {
const IntImmNode* rank = newshape->shape[0].as<IntImmNode>();
ICHECK(rank != nullptr) << "Dynamic Reshape doesn't support Dynamic Rank";
for (int i = 0; i < rank->value; i++) {
oshape.push_back(Any());
}

Expand Down

0 comments on commit 3eb9062

Please sign in to comment.