(self, log_dir: str)
| 80 | |
| 81 | class 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: |
nothing calls this directly
no outgoing calls
no test coverage detected