Skip to content

Commit c2c0906

Browse files
ToucheSirBrian Chen
andauthored
Fix set_step_increment! (#75)
* Fix set_step_increment! Was incorrectly setting the global step instead. * bump version Co-authored-by: Brian Chen <brian.chen@queensu.ca>
1 parent febbad6 commit c2c0906

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorBoardLogger"
22
uuid = "899adc3e-224a-11e9-021f-63837185c80f"
33
authors = ["Filippo Vicentini <filippovicentini@gmail.com>"]
4-
version = "0.1.10"
4+
version = "0.1.11"
55

66
[deps]
77
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"

src/TBLogger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ each time logging is performed.
174174
175175
Can be overidden by passing `log_step_increment=some_increment` when logging.
176176
"""
177-
set_step_increment!(lg::TBLogger, step) = lg.global_step = step
177+
set_step_increment!(lg::TBLogger, Δstep) = lg.step_increment = Δstep
178178

179179
"""
180180
increment_step!(lg, Δ_Step) -> Int

test/test_TBLogger.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ end
6767

6868
@test set_step!(tbl, 1) == 1
6969
@test tb_step(tbl) == 1
70+
71+
@test set_step_increment!(tbl, 10) == 10
72+
# changing the increment should not affect the step
73+
@test tb_step(tbl) == 1
7074
end
7175

7276
@testset "resetting" begin

0 commit comments

Comments
 (0)