Skip to content

Commit

Permalink
Fix set_step_increment! (#75)
Browse files Browse the repository at this point in the history
* Fix set_step_increment!

Was incorrectly setting the global step instead.

* bump version

Co-authored-by: Brian Chen <[email protected]>
  • Loading branch information
ToucheSir and Brian Chen authored Aug 28, 2020
1 parent febbad6 commit c2c0906
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TensorBoardLogger"
uuid = "899adc3e-224a-11e9-021f-63837185c80f"
authors = ["Filippo Vicentini <[email protected]>"]
version = "0.1.10"
version = "0.1.11"

[deps]
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
Expand Down
2 changes: 1 addition & 1 deletion src/TBLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ each time logging is performed.
Can be overidden by passing `log_step_increment=some_increment` when logging.
"""
set_step_increment!(lg::TBLogger, step) = lg.global_step = step
set_step_increment!(lg::TBLogger, Δstep) = lg.step_increment = Δstep

"""
increment_step!(lg, Δ_Step) -> Int
Expand Down
4 changes: 4 additions & 0 deletions test/test_TBLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ end

@test set_step!(tbl, 1) == 1
@test tb_step(tbl) == 1

@test set_step_increment!(tbl, 10) == 10
# changing the increment should not affect the step
@test tb_step(tbl) == 1
end

@testset "resetting" begin
Expand Down

2 comments on commit c2c0906

@PhilipVinc
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/20437

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 the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.11 -m "<description of version>" c2c09062d7039cbbbeb827b21feec26732bc3d08
git push origin v0.1.11

Please sign in to comment.