Closed DhairyaLGandhi closed 4 years ago
Simple mwe:
julia> using LinearAlgebra
julia> ndims(LinearAlgebra.Transpose{Float64,Array{Float64,1}})
2
julia> using Adapt
julia> ndims(LinearAlgebra.Transpose{Float64,Array{Float64,1}})
1
Ah, that's unfortunate. Extending ndims
feels like a form of piracy indeed, but on the other hand we need exactly that definition to reconstruct the wrapper so it seems silly to use a different name for that property. It would also be breaking, so let's postpone that for a next major release.
On Adapt@1.1
project
``` (Tracker) pkg> st Project Tracker v0.2.6 Status `~/.julia/dev/Tracker/Project.toml` [79e6a3ab] Adapt v1.1.0 [b552c78f] DiffRules v1.0.1 [f6369f11] ForwardDiff v0.10.10 [1914dd2f] MacroTools v0.5.5 [872c559c] NNlib v0.6.6 [77ba4419] NaNMath v0.3.3 [ae029012] Requires v1.0.1 [276daf66] SpecialFunctions v0.8.0 [37e2e46d] LinearAlgebra [de0858da] Printf [9a3f8284] Random [10745b16] Statistics [8dfed614] Test ```This works as expected:
On Adapt@2
project
``` (Tracker) pkg> st Project Tracker v0.2.6 Status `~/Downloads/new_clones/Tracker.jl/Project.toml` [79e6a3ab] Adapt v2.0.0 [b552c78f] DiffRules v1.0.1 [f6369f11] ForwardDiff v0.10.10 [1914dd2f] MacroTools v0.5.5 [872c559c] NNlib v0.7.0 [77ba4419] NaNMath v0.3.3 [ae029012] Requires v1.0.1 [276daf66] SpecialFunctions v0.10.3 [37e2e46d] LinearAlgebra [de0858da] Printf [9a3f8284] Random [10745b16] Statistics [8dfed614] Test ```The
WrappedArray
version gets called, and returns the incorrect resultEven if it were reporting the right
ndims
should it count as piracy?