Template Function tvm::prim::TryConstFold(PrimExpr, PrimExpr)#
Defined in File const_fold.h
Function Documentation#
-
template<typename Op>
inline ffi::Optional<PrimExpr> tvm::prim::TryConstFold(PrimExpr a, PrimExpr b)# Try to run binary compute with constant folding.
Note
a and b Must already matched data types with each other.
- Parameters:
a – The left operand.
b – The right operand.
- Template Parameters:
Op – The operator type.
- Returns:
std::nullopt if constant fold fails, otherwise return folded result.