Skip to main content

cast

Function cast 

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

Convert value to the type ty, folding a constant that keeps its value and broadcasting a scalar to a vector type.

Cast::new builds the node without folding.

ยงErrors

Returns a TypeError if value has the void type, or an InternalError if value and ty are vectors of different lanes.