mlx_cast() converts an mlx array to a different dtype without
changing its shape.
Examples
x <- mlx_vector(1:3, dtype = "int32")
mlx_cast(x, dtype = "float32")
#> mlx array [3]
#> dtype: float32
#> values:
#> [1] 1 2 3
mlx_cast() converts an mlx array to a different dtype without
changing its shape.
x <- mlx_vector(1:3, dtype = "int32")
mlx_cast(x, dtype = "float32")
#> mlx array [3]
#> dtype: float32
#> values:
#> [1] 1 2 3