Function tvm::prim::cast#
Defined in File op.h
Function Documentation#
-
PrimExpr tvm::prim::cast(PrimExpr value, PrimType t, Location loc = UnknownLoc())#
cast value to type.
Note
This function may return value if the type is the same. Constant folding is limited to supported conversions whose results fit the destination type. Use MakeConst to construct typed literals directly.
- Parameters:
value – The value
t – the target type.
loc – The location of this operation in the source.
- Returns:
The result expression.