tvm_tirx::ir::prim::op

Function cast

Source
pub fn cast(value: impl IntoExpr, ty: impl Into<PrimType>) -> Result<Expr>
Expand description

value converted to ty (C++ prim::cast(value, t), prim._cast): a value already of that type is itself, a constant is folded when the result is the same value in ty, a scalar cast to a vector type is broadcast, a broadcast is cast element by element, and so is a constant ramp cast to an integer type when every lane fits both types; anything else is a Cast node, which Cast::new builds in every case.