Template Function tvm::prim::TryConstFold(PrimExpr)

Template Function tvm::prim::TryConstFold(PrimExpr)#

Function Documentation#

template<typename Op>
inline ffi::Optional<PrimExpr> tvm::prim::TryConstFold(PrimExpr a)#

Try to run unary compute with constant folding.

Note

a and b Must already matched data types with each other.

Parameters:

a – The left operand.

Template Parameters:

Op – The operator type.

Returns:

std::nullopt if constant fold fails, otherwise return folded result.