Skip to content

Commit

Permalink
remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed Dec 3, 2022
1 parent 2823af3 commit d67d3ce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/autodiff/yota.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
using ProximalCore
using .Yota: grad

struct YotaFunction{F}
f::F
end

(f::YotaFunction)(x) = f.f(x)

function ProximalCore.gradient!(grad_x, f::YotaFunction, x)
f_x, g = grad(f.f, x)
grad_x .= g[2]
Expand Down
6 changes: 0 additions & 6 deletions src/autodiff/zygote.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
using ProximalCore
using .Zygote: pullback

struct ZygoteFunction{F}
f::F
end

(f::ZygoteFunction)(x) = f.f(x)

function ProximalCore.gradient!(grad_x, f::ZygoteFunction, x)
f_x, pb = pullback(f.f, x)
grad_x .= pb(one(f_x))[1]
Expand Down

0 comments on commit d67d3ce

Please sign in to comment.