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

Derivatives do not work with non-float types? #206

Open
bvdmitri opened this issue Aug 21, 2023 · 1 comment
Open

Derivatives do not work with non-float types? #206

bvdmitri opened this issue Aug 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bvdmitri
Copy link

bvdmitri commented Aug 21, 2023

E.g. this works fine

julia> derivative(DiffractorForwardBackend(), (a, b) -> sin(a) * cos(b), 1.0, 1.0)

but not this

julia> derivative(DiffractorForwardBackend(), (a, b) -> sin(a) * cos(b), 1, 1)
ERROR: MethodError: no method matching Diffractor.Jet(::Int64, ::Float64, ::Tuple{Float64})

Closest candidates are:
  Diffractor.Jet(::T, ::T, ::Tuple{Vararg{T, N}}) where {T, N}
   @ Diffractor ~/.julia/packages/Diffractor/vzpvE/src/jet.jl:19

Stacktrace:
  [1] njet(::Val{1}, ::typeof(sin), x₀::Int64)
    @ Diffractor ~/.julia/packages/Diffractor/vzpvE/src/higher_fwd_rules.jl:7
  [2] (::Diffractor.∂☆{1})(fb::ZeroBundle{1, typeof(sin)}, x::Diffractor.TangentBundle{1, Int64, Diffractor.TaylorTangent{…}})

and not this

julia> derivative(DiffractorForwardBackend(), (a, b) -> sin(a) * cos(b), π, 1.0)
ERROR: MethodError: no method matching Diffractor.Jet(::Irrational{:π}, ::Float64, ::Tuple{Float64})

Closest candidates are:
  Diffractor.Jet(::T, ::T, ::Tuple{Vararg{T, N}}) where {T, N}
   @ Diffractor ~/.julia/packages/Diffractor/vzpvE/src/jet.jl:19

Stacktrace:
  [1] njet(::Val{1}, ::typeof(sin), x₀::Irrational{:π})
julia> versioninfo()
Julia Version 1.10.0-beta1
Commit 6616549950e (2023-07-25 17:43 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 12 × Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 12 virtual cores
(jl_8k1XbP) pkg> st
Status `/private/var/folders/86/jlqr7cg52h3dd15zrj_145sr0000gn/T/jl_8k1XbP/Project.toml`
  [c29ec348] AbstractDifferentiation v0.5.2
  [9f5e2b26] Diffractor v0.2.1
@oxinabox oxinabox added the bug Something isn't working label Aug 22, 2023
@oxinabox
Copy link
Member

should be an easy fix to relax the type constraints on the Jets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants