From 5f9d8702a41410ebe6591c3d3120bc099b3885e5 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Fri, 18 Aug 2017 00:49:51 +0100 Subject: [PATCH] remove old cb macro --- src/training.jl | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/training.jl b/src/training.jl index 3632eb82..780303d8 100644 --- a/src/training.jl +++ b/src/training.jl @@ -1,30 +1,6 @@ using Juno: info using .Batches: tobatch -""" - @cb for ... end t expr - -Run the for loop, executing `expr` every `t` seconds. -""" -macro cb(ex, t, f) - @assert isexpr(ex, :for) - cond, body = ex.args - @esc t f cond body - :(let - t0 = time_ns() - dt = $t*1e9 - @progress $(Expr(:for, cond, quote - t = time_ns() - if t - t0 > dt - t0 = t - f = () -> $f - f() - end - $body - end)) - end) -end - """ Returns a function that when invoked, will only be triggered at most once during `timeout` seconds. Normally, the throttled function will run