-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
For y=norm(x[, p])
, if p
is not provided, jvp
produces the correct tangent vector (with the same shape as y
), but if p
is provided, it returns a scalar.
julia> x, Δx = [1.0, 2.0, 3.0], [0.3, 0.2, 0.1];
julia> p, Δp = 2.0, 0.5;
julia> normalize(x)
3-element Array{Float64,1}:
0.2672612419124244
0.5345224838248488
0.8017837257372732
julia> jvp(central_fdm(5, 1), normalize, (x, Δx)) # 1-arg looks good
3-element Array{Float64,1}:
0.061088283865706784
0.015272070966444149
-0.0305441419328158
julia> normalize(x, p)
3-element Array{Float64,1}:
0.2672612419124244
0.5345224838248488
0.8017837257372732
julia> jvp(central_fdm(5, 1), normalize, (x, Δx), (p, Δp)) # um, what?
0.08883239652055
Metadata
Metadata
Assignees
Labels
No labels