William Moses

Results 889 comments of William Moses

In case in my tired "create rebuttals for paper reviews haze" caused the message to come across wrong, I do agree Enzyme should handle differentiation of integer quantities -- though...

This now gives a julia-level error, but is the same error needing fixing.

@vchuravy interestingly this now segfaults.

``` wmoses@beast:~/git/Enzyme.jl ((HEAD detached at origin/main)) $ cat vs.jl using Enzyme, ValueShapes Enzyme.API.printall!(true) function diffeq_step!(u) vs_u = NamedTupleShape(ShapedAsNT, x = ArrayShape{Real}(2), ) shaped_u = ShapedAsNT(u, vs_u) # Causes the Enzyme...

I think the issue here is that since the dual returns two values it is ambiguous what return you are differentiating with respect to. In fact, since you didn't specify...

``` wmoses@beast:~/git/Enzyme.jl ((HEAD detached at origin/main)) $ ./julia-1.7.2/bin/julia --project fwdcomb.jl isapprox(y, 1.0) = false "Const regular" = "Const regular" dual_x = ForwardDiff.Dual{Nothing, Float64, 1}[Dual{Nothing}(0.5,0.0), Dual{Nothing}(0.6666666666666666,0.0)] dual_dx = ForwardDiff.Dual{Nothing, Float64, 1}[Dual{Nothing}(0.0,0.0),...

I think what happens here is that Enzyme just doesn't automatically determine that the return type of Dual should be considered active and falls back to const. See: ``` julia>...

The (reasonable) reason for the iffiness is for a regular floating point value its clear that is the value being differentiated wrt. For a tuple (like here), it's unclear if...

You should be able to express your specific behavior by either returning the primal or dual value in the function being differentiated (e.g. `reduce(*, x).value` or `reduce(*, x).partials`) or using...