Skip to content

Commit

Permalink
update check non negative
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmovic committed May 29, 2024
1 parent 0a78cdc commit b0881a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions oneflow/core/functional/impl/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ Maybe<void> CheckInplaceShapeCanExpandTo(const Shape& shape, const Shape& expand

Maybe<void> CheckSizeNonNegative(const Shape& shape) {
for (const auto& s : shape) {
CHECK_OR_THROW(s >= 0)
<< "Trying to create tensor with negative dimension " << s << ": "
<< shape;
CHECK_OR_RETURN(s >= 0) << "Trying to create tensor with negative dimension " << s << ": "
<< shape;
}
return Maybe<void>::Ok();
}
Expand Down

0 comments on commit b0881a8

Please sign in to comment.