Skip to content

Change AbstractVector to AbstractArray{T,1}#45

Merged
tansongchen merged 1 commit intoJuliaDiff:mainfrom
mBarreau:main
Aug 23, 2023
Merged

Change AbstractVector to AbstractArray{T,1}#45
tansongchen merged 1 commit intoJuliaDiff:mainfrom
mBarreau:main

Conversation

@mBarreau
Copy link
Contributor

Currently, it is not possible to use slices of a matrix in TaylorDiff because this is not of type AbstractVector (see https://discourse.julialang.org/t/speed-up-compilation-with-zygote-and-pinn/99652/4 where a conversion is needed)

This PR changes the type AbstractVector{N} to AbstractArray{T,1}, allowing the use of subvectors.

@tansongchen tansongchen merged commit 1aa65d7 into JuliaDiff:main Aug 23, 2023
@tansongchen
Copy link
Member

Hi, this is definitely reasonable and thanks for help.

@tansongchen
Copy link
Member

Wait, @mBarreau , isn't it that AbstractVector and AbstractArray{T, 1} are the same thing?

julia> AbstractVector
AbstractVector (alias for AbstractArray{T, 1} where T)

@mBarreau
Copy link
Contributor Author

@tansongchen
I did not see you replied. Indeed it is, I was incorrect on the source of the error (I worked on an old version of TaylorDiff initially).
The problem with the current code is that x and l must be of same type. This is something I talk about in the other PR: #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants