Will Tebbutt
                                            Will Tebbutt
                                        
                                    Sketch implementation for `to_vec_tangent` (untested): ```julia function to_vec_tangent(x::Real) Real_Tangent_from_vec(x_vec) = first(x_vec) return [x], Real_Tangent_from_vec end function to_vec_tangent(z::Complex) Complex_Tangent_from_vec(z_vec) = Complex(z_vec[1], z_vec[2]) return [real(z), imag(z)], Complex_Tangent_from_vec end to_vec_tangent(x::Vector{ x) # Any...
> I suspect the easy fix for issues with test_approx right now is to not use it directly on tangents, but rather add the primal to each tangent being compared...
Fun story: I managed to get the default `to_vec` for `struct`s to successfully `to_vec` a `Dict`. I did this by defining undefined / unassigned entries in arrays to be non-differentiable...
Oh, wait, Zygote already has an example of this implemented [here](https://github.com/FluxML/Zygote.jl/blob/05d0c2ae04f334a2ec61e42decfe1172d0f2e6e8/src/compiler/chainrules.jl#L177). I got the impression from the docs that we'd have to implement it ourselves. Would be good to highlight...
Ahh I see. My bad for not reading the docs more thoroughly. Would a working example that users can copy + paste involving Zygote make sense to add? Something like...
Another thing to consider is that we're currently generating entire `vjp`s, rather than `vjvp`s (vector-Jacobian-vector products), which would be sufficient. The thing that we really _need_ to test for reverse-mode...
> Yeah, and dot i.e. inner product is something all tangent types should overload. Indeed. > A problem maybe is if it fails that won't tell you where you failed,...
Had a quick stab at doing this (I'll not be pushing this further myself in the immediate future, just wanted to see what it might look like) https://github.com/JuliaDiff/ChainRulesTestUtils.jl/pull/208 On the...
I maintain that `rand_tangent` currently has the correct default behaviour. As I see it, there are two things that need to be done. ### First thing 1. signpost it better:...
> We can't easily test φ(a+b) = φ(a) + φ(b) though, as we only have one differential. Could we just introduce two scalars `p` and `q` s.t. `p + q...