diff --git a/oneflow/core/functional/impl/common.cpp b/oneflow/core/functional/impl/common.cpp index 24b123aee87..06c74ce727a 100644 --- a/oneflow/core/functional/impl/common.cpp +++ b/oneflow/core/functional/impl/common.cpp @@ -204,7 +204,7 @@ Maybe CheckInplaceShapeCanExpandTo(const Shape& shape, const Shape& expand return Maybe::Ok(); } -Maybe CheckSizeNonNegative(const Shape& shape) { +inline Maybe CheckSizeNonNegative(const Shape& shape) { for (const auto& s : shape) { CHECK_OR_THROW(s >= 0) << "Trying to create tensor with negative dimension " << s << ": "