Function tvm::if_then_else(PrimExpr, PrimExpr, PrimExpr, Location)

Function tvm::if_then_else(PrimExpr, PrimExpr, PrimExpr, Location)#

Function Documentation#

PrimExpr tvm::if_then_else(PrimExpr cond, PrimExpr true_value, PrimExpr false_value, Location loc = UnknownLoc())#

Conditional expression.

Note

this function does eager constant folding for index types(int32, int64) when possible.

Parameters:
  • cond – The condition

  • true_value – The value when results are true.

  • false_value – The value when results are false.

  • loc – The location of this operation in the source.

Returns:

The result expression.