Skip to content

Commit

Permalink
Merge #551
Browse files Browse the repository at this point in the history
551: @Nograd printing r=willtebbutt a=willtebbutt

Resolves #548 .

Bumps patch so that we can make this available immediately.

Co-authored-by: willtebbutt <[email protected]>
  • Loading branch information
bors[bot] and willtebbutt authored Mar 20, 2020
2 parents f16d856 + 047d8e6 commit 24f9c58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Zygote"
uuid = "e88e6eb3-aa80-5325-afca-941959d7151f"
version = "0.4.10"
version = "0.4.11"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/base.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@nograd readline, Base.gc_num, Base.time_ns
@nograd readline, Base.gc_num, Base.time_ns, Base.print, Base.println, Base.show,
Core.show, Core.print, Core.println

# Gradient of AD stacks

Expand Down
13 changes: 13 additions & 0 deletions test/gradcheck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ end

Random.seed!(0)

@testset "println, show, print" begin
function foo(x)
Base.show(x)
Base.print(x)
Base.println(x)
Core.show(x)
Core.print(x)
Core.println(x)
return x
end
@test gradtest(foo, [5.0])
end

@test gradient(//, 2, 3) === (1//3, -2//9)

@testset "power" begin
Expand Down

2 comments on commit 24f9c58

@willtebbutt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/11396

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.11 -m "<description of version>" 24f9c58ce5ea816bfbcd163fbde61dfdf55e8b69
git push origin v0.4.11

Please sign in to comment.