MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/utils/logger.py:82–91  ·  view source on GitHub ↗
(self, log_dir: str)

Source from the content-addressed store, hash-verified

80
81class TensorBoardLogger:
82 def __init__(self, log_dir: str):
83 self.log_dir = log_dir
84
85 try:
86 from torch.utils.tensorboard import SummaryWriter
87 self.writer = SummaryWriter(log_dir)
88 self.enabled = True
89 except ImportError:
90 print("TensorBoard not available. Skipping TensorBoard logging.")
91 self.enabled = False
92
93 def log_scalar(self, tag: str, value: float, step: int):
94 if self.enabled:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected