Skip to content

Commit b0881a8

Browse files
committed
update check non negative
1 parent 0a78cdc commit b0881a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

oneflow/core/functional/impl/common.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ Maybe<void> CheckInplaceShapeCanExpandTo(const Shape& shape, const Shape& expand
206206

207207
Maybe<void> CheckSizeNonNegative(const Shape& shape) {
208208
for (const auto& s : shape) {
209-
CHECK_OR_THROW(s >= 0)
210-
<< "Trying to create tensor with negative dimension " << s << ": "
211-
<< shape;
209+
CHECK_OR_RETURN(s >= 0) << "Trying to create tensor with negative dimension " << s << ": "
210+
<< shape;
212211
}
213212
return Maybe<void>::Ok();
214213
}

0 commit comments

Comments
 (0)