Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Jun 14, 2022
1 parent 416f0fa commit de72a12
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,24 +530,12 @@ the trailing edge, pass `trailing=true`.
```jldoctest
julia> a = Flux.throttle(() -> println("Flux"), 2);
julia> a()
Flux
julia> for i = 1:4 # sleeps for 1 second -> the function can be called in alternate iterations
julia> for i = 1:4 # a called in alternate iterations
a()
sleep(1.5)
sleep(1)
end
Flux
Flux
julia> for i = 1:4 # sleeps for 2 second -> the function can be called in the next iteration
a()
sleep(2)
end
Flux
Flux
Flux
Flux
```
"""
function throttle(f, timeout; leading=true, trailing=false)
Expand Down

0 comments on commit de72a12

Please sign in to comment.