From b0881a82396350c5fb8bdc96e87fd655654b6da7 Mon Sep 17 00:00:00 2001 From: Dmovic <944388576@qq.com> Date: Wed, 29 May 2024 08:51:56 +0000 Subject: [PATCH] update check non negative --- oneflow/core/functional/impl/common.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oneflow/core/functional/impl/common.cpp b/oneflow/core/functional/impl/common.cpp index 24b123aee87..a175873c06a 100644 --- a/oneflow/core/functional/impl/common.cpp +++ b/oneflow/core/functional/impl/common.cpp @@ -206,9 +206,8 @@ Maybe CheckInplaceShapeCanExpandTo(const Shape& shape, const Shape& expand Maybe 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::Ok(); }