Skip to content

Commit 82f0394

Browse files
v0.2.43
SummaryWriter added for backward compatibility
1 parent 7847aed commit 82f0394

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotPython"
10-
version = "0.2.42"
10+
version = "0.2.43"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/utils/init.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

33
# PyTorch TensorBoard support
4-
# from torch.utils.tensorboard import SummaryWriter
4+
from torch.utils.tensorboard import SummaryWriter
55

66

77
def fun_control_init(task, tensorboard_path=None, num_workers=0, device=None):
@@ -43,10 +43,11 @@ def fun_control_init(task, tensorboard_path=None, num_workers=0, device=None):
4343
# create tensorboard_path if it does not exist
4444
if not os.path.exists(tensorboard_path):
4545
os.makedirs(tensorboard_path)
46-
# Starting with v0.2.41, Summary Writer is not initialized here but by Lightning
47-
# writer = SummaryWriter(tensorboard_path)
48-
# else:
49-
# writer = None
46+
# Starting with v0.2.41, Summary Writer should be not initialized here but by Lightning
47+
# it is only available for compatibility reasons
48+
writer = SummaryWriter(tensorboard_path)
49+
else:
50+
writer = None
5051

5152
fun_control = {
5253
"data": None,
@@ -73,5 +74,6 @@ def fun_control_init(task, tensorboard_path=None, num_workers=0, device=None):
7374
"tensorboard_path": tensorboard_path,
7475
"save_model": False,
7576
"weights": 1.0,
77+
"writer": writer,
7678
}
7779
return fun_control

0 commit comments

Comments
 (0)