def init_writer(self, log_dir):
    if ((self.__dict__.get('_writer') is None) or (self._writer is None)):
        print('Initializing summary writer for tensorboard with log_dir={}'.format(log_dir))
        self._writer = SummaryWriter(log_dir=log_dir)
def init_writer(self, log_dir):
    if ((self.__dict__.get('_writer') is None) or (self._writer is None)):
        print('Initializing summary writer for tensorboard with log_dir={}'.format(log_dir))
        self._writer = SummaryWriter(log_dir=log_dir)