Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Add partial_apply
Browse files Browse the repository at this point in the history
This calls `apply` and only returns the first argument.
  • Loading branch information
SebastianM-C committed Feb 13, 2024
1 parent 051c3b1 commit fd9a91f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/LuxCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ Simply calls `model(x, ps, st)`
"""
apply(model::AbstractExplicitLayer, x, ps, st) = model(x, ps, st)

"""
partial_apply(model, x, ps, st)
Calls `apply` and only returns the first argument.
"""
function partial_apply(model::AbstractExplicitLayer, x, ps, st)
return first(apply(model, x, ps, st))
end

"""
display_name(layer::AbstractExplicitLayer)
Expand Down

0 comments on commit fd9a91f

Please sign in to comment.