Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector-valued functions #46

Closed
landreman opened this issue Aug 25, 2023 · 3 comments
Closed

Vector-valued functions #46

landreman opened this issue Aug 25, 2023 · 3 comments

Comments

@landreman
Copy link

Hi, what would be involved in applying TaylorDiff to vector-valued functions? When I try now (with Julia 1.9.2 and TaylorDiff 0.2.1 or main), TaylorDiff.derivative returns false instead of the correct derivative. Example:

using TaylorDiff
using ForwardDiff

f(x) = [x, 2x]

x0 = 0.2

@show ForwardDiff.derivative(f, x0)  # Returns [1.0, 2.0] as expected
@show TaylorDiff.derivative(f, x0, 1)  # Returns false

Thanks.

@tansongchen
Copy link
Member

TaylorDiff.jl should be able to handle vector valued functions, that is weird. I will take a look.

@tansongchen
Copy link
Member

Just updated the main branch, please test again. Now you should be able to do any AbstractArray-valued functions.

@landreman
Copy link
Author

Perfect, works now. Thank you!

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

No branches or pull requests

2 participants