Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
denizyuret committed Jan 20, 2019
1 parent 939702f commit 8f581dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Regular `*` is matrix multiplication, broadcasted `*` is elementwise multiplicat
two have different gradients as defined above. `unbroadcast(a,b)` reduces `b` to the same
shape as `a` by performing the necessary summations.
"""
:(@primitive), :(@primitive1), :(@primitive2)

macro primitive(f,g...) # @primitive sin(x::Number),dy,y (dy.*cos.(x))
(f,dy,y) = fparse(f)
b = Expr(:block)
Expand Down Expand Up @@ -151,6 +153,8 @@ define the broadcasting version and `@zerograd2` if you only want to define the
version. Note that `kwargs` are NOT unboxed.
"""
:(@zerograd), :(@zerograd1), :(@zerograd2)

macro zerograd(f) # @zerograd sign(x::Number)
(f,dy,y) = fparse(f)
b = Expr(:block)
Expand Down
2 changes: 1 addition & 1 deletion test/gradcheck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ gradient of `sum(f(x...; kw...))`. Keyword arguments:
* `verbose=1`: 0 prints nothing, 1 shows failing tests, 2 shows all tests.
"""
gcheck, @gcheck
gcheck, :(@gcheck)

function gcheck(f, x...; kw=(), nsample=10, verbose=1, rtol=0.05, atol=0.01, delta=0.0001)
y = @diff gcsum(f, x...; kw...)
Expand Down

0 comments on commit 8f581dd

Please sign in to comment.