sayakpaul's picture
sayakpaul HF staff
add files
c4b2b37
raw
history blame contribute delete
313 Bytes
import os
from torch.utils.tensorboard import SummaryWriter
class TensorboardSummary(object):
def __init__(self, directory):
self.directory = directory
self.writer = SummaryWriter(log_dir=os.path.join(self.directory))
def add_scalar(self, *args):
self.writer.add_scalar(*args)