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

make functions usable with ForwardDiff.jl #206

Open
tpapp opened this issue Aug 18, 2016 · 3 comments
Open

make functions usable with ForwardDiff.jl #206

tpapp opened this issue Aug 18, 2016 · 3 comments

Comments

@tpapp
Copy link
Contributor

tpapp commented Aug 18, 2016

While ForwardDiff.jl recommends that functions accept generic Vector, StatsBase.jl specializes functions to RealArray, making them unusable with ForwardDiff.jl (eg mean_and_var, etc).

I would be happy to contribute a PR, but I am wondering what the preferred solution would be, eg

  1. extend RealArray to a union with types that ForwardDiff.jl would use,
  2. replace RealArray with Vector
@andreasnoack
Copy link
Member

I don't that we need to be overly strict about the typing of these functions. We should consider using AbstractVector and a PR would be great.

@tpapp
Copy link
Contributor Author

tpapp commented Aug 21, 2016

Apparently this is fixed by JuliaDiff/ForwardDiff.jl@934b3b2 which makes Dual{N,T<:Real} <: Real.

If you think it is necessary, I can still submit some tests to make sure that this keeps working.

@nalimilan
Copy link
Member

Tests are certainly a good idea if you want some functionality to keep working in the future.

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

3 participants