Convert a tuple of matrix Float64 data to Float32

I have a tuple of matrices data of type Float64 .


But when i want to convert it to Float32 it gives error

How to convert a tuple of matrix Float64 data to Float32 ?

Actually, you are broadcasting over a tuple.

x, z = map(x -> Float32.(x), spherical_to_cartesian(r, theta))

Or more simply:

x, z = Matrix{Float32}.(spherical_to_cartesian(r, theta))
1 Like