docstr: Accessor to TensorBoard's SummaryWriter
docstr_tok: ["Accessor","to","TensorBoard","'s","SummaryWriter"]
code: def summary_writer(self):
      """
      Accessor to TensorBoard's SummaryWriter
      """
      if self._summary_writer_logger is self.logger:
          # If self.logger doesn't change between call, then return cached result
          return self._summary_writer
  
      # Invalidate
      self._summary_writer = None
      self._summary_writer_logger = self.logger
  
      if isinstance(self.logger, pl.loggers.base.LoggerCollection):
          for logger in self.logger._logger_iterable:
              if isinstance(
                  logger, pl.loggers.tensorboard.TensorBoardLogger
              ):
                  self._summary_writer = logger.experiment
                  break
      elif isinstance(logger, pl.loggers.tensorboard.TensorBoardLogger):
          self._summary_writer = logger.experiment
  
      return self._summary_writer
  
imports: import inspect
  import logging
  import pytorch_lightning
  import torch
  from reagent.core.tensorboardX import SummaryWriterContext
  from reagent.core.utils import lazy_property
  from typing_extensions import final
label_desc: Use image node_id 9 for calling the ReAgentLightningModule obj's underlying member method code with example usage: obj.summary_writer() and returns: self, self