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

frules for one are ambiguous #769

Closed
MasonProtter opened this issue Jan 15, 2024 · 0 comments
Closed

frules for one are ambiguous #769

MasonProtter opened this issue Jan 15, 2024 · 0 comments

Comments

@MasonProtter
Copy link
Contributor

  MethodError: frule(::Tuple{ZeroTangent, Float64}, ::typeof(one), ::Float64) is ambiguous.
  
  Candidates:
    frule(::Tuple, ::typeof(one), var"1277")
      @ ChainRules ~/.julia/packages/ChainRules/pEOSw/src/rulesets/Base/nondiff.jl:336
    frule(::Any, ::typeof(one), x::Number)
      @ ChainRules ~/.julia/packages/ChainRules/pEOSw/src/rulesets/Base/base.jl:6

  Possible fix, define
    frule(::Tuple, ::typeof(one), ::Number

These methods come from

@non_differentiable one(::Any)

and

@scalar_rule one(x) ZeroTangent()

respectively. It seems like either @non_differentiable should not use a ::Tuple type restriction, or @scalar_rule should add a ::Tuple type restriction.

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 a pull request may close this issue.

1 participant