Skip to main content
Log in

Mojo function

cast

cast(v: Symbol, dtype: DType) -> Symbol

Casts a symbolic tensor to a different data type.

Args:

  • v (Symbol): The input tensor to cast.
  • dtype (DType): The target dtype to which the tensor is cast.

Returns:

A new symbolic tensor with the same shape as the input and the specified dtype.

Was this page helpful?