Skip to content

Commit

Permalink
Some more small modifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkschleg committed Aug 9, 2023
1 parent c4d92b1 commit 52f3b7f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/new_recur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import Compat: stack
"""
scan_full
Recreating jax.lax.scan functionality in julia. Takes a function, initial carry and a sequence,
then returns the full output of the sequence and the final carry. See `scan_partial` to only
return the final output of the sequence.
Recreating jax.lax.scan functionality in julia. Takes a function, initial carry and a sequence, then returns the full output of the sequence and the final carry. See `scan_partial` to only return the final output of the sequence.
"""
function scan_full(func, init_carry, xs::AbstractVector{<:AbstractArray})
# Recurrence operation used in the fold. Takes the state of the
Expand Down Expand Up @@ -66,9 +64,7 @@ end
"""
scan_partial
Recreating jax.lax.scan functionality in julia. Takes a function, initial carry and a sequence,
then returns the final output of the sequence and the final carry. See `scan_full` to return
the entire output sequence.
Recreating jax.lax.scan functionality in julia. Takes a function, initial carry and a sequence, then returns the final output of the sequence and the final carry. See `scan_full` to return the entire output sequence.
"""
function scan_partial(func, init_carry, xs::AbstractVector{<:AbstractArray})
x_init, x_rest = Iterators.peel(xs)
Expand Down Expand Up @@ -96,10 +92,7 @@ end

"""
NewRecur
New Recur. An experimental recur interface for removing statefullness in recurrent architectures for flux.
This struct has two type parameters. The first `RET_SEQUENCE` is a boolean which determines whether `scan_full`
(`RET_SEQUENCE=true`) or `scan_partial` (`RET_SEQUENCE=false`) is used to scan through the sequence. This
structure has no internal state, and instead returns:
New Recur. An experimental recur interface for removing statefullness in recurrent architectures for flux. This struct has two type parameters. The first `RET_SEQUENCE` is a boolean which determines whether `scan_full` (`RET_SEQUENCE=true`) or `scan_partial` (`RET_SEQUENCE=false`) is used to scan through the sequence. This structure has no internal state, and instead returns:
```julia
l = NewRNN(1,2)
Expand Down

0 comments on commit 52f3b7f

Please sign in to comment.