How to convert vectors and arrays from Float32 to Float64?

You can also use convert but with the “full type”:

julia> convert(Vector{Float64}, x_f32)
2-element Vector{Float64}:
 1.0
 2.0

julia> convert(Vector{Float64}, x_f64)
2-element Vector{Float64}:
 1.0
 2.0

The advantage over Float64.(x) is that it is a no-op if the data is already of the correct type:

julia> convert(Vector{Float64}, x_f64) === x_f64
true
9 Likes