You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That can be attributed IMO to LinearAlgebra.promote_leaf_types:
julia> LinearAlgebra.promote_leaf_eltypes(Any[123.4])
Float64
julia> LinearAlgebra.promote_leaf_eltypes(Number[123.4])
Number
That should return Float64 in both cases. As a consequence, isapprox would and should return true in all cases.
The first two methods in
promote_leaf_eltypes(x::Union{AbstractArray{T},Tuple{T,Vararg{T}}}) where {T<:Number} = T
promote_leaf_eltypes(x::Union{AbstractArray{T},Tuple{T,Vararg{T}}}) where {T<:NumberArray} =eltype(T)
promote_leaf_eltypes(x::T) where {T} = T
promote_leaf_eltypes(x::Union{AbstractArray,Tuple}) =mapreduce(promote_leaf_eltypes, promote_type, x; init=Bool)
are probably not ideal when T is not a concrete type, since T <: Number for e.g. Number, Real, Complex, and AbstractFloat. In these cases they don't match the definition in the last line, or the documented behaviour of this function being the same as promote_type(typeof(leaf1), typeof(leaf2), ...). Perhaps these methods need to be updated to account for this case.
This is quite problematic:
The text was updated successfully, but these errors were encountered: