parameters: (self, model, input_to_model=None, verbose=False, use_strict_trace=True)
docstring: Add graph data to summary.
  
          Args:
              model (torch.nn.Module): Model to draw.
              input_to_model (torch.Tensor or list of torch.Tensor): A variable or a tuple of
                  variables to be fed.
              verbose (bool): Whether to print graph structure in console.
              use_strict_trace (bool): Whether to pass keyword argument `strict` to
                  `torch.jit.trace`. Pass False when you want the tracer to
                  record your mutable container types (list, dict)
docstring_summary: Add graph data to summary.
docstring_tokens: Add graph data to summary .
function: def add_graph(self, model, input_to_model=None, verbose=False, use_strict_trace=True):
          """Add graph data to summary.
  
          Args:
              model (torch.nn.Module): Model to draw.
              input_to_model (torch.Tensor or list of torch.Tensor): A variable or a tuple of
                  variables to be fed.
              verbose (bool): Whether to print graph structure in console.
              use_strict_trace (bool): Whether to pass keyword argument `strict` to
                  `torch.jit.trace`. Pass False when you want the tracer to
                  record your mutable container types (list, dict)
          """
          torch._C._log_api_usage_once("tensorboard.logging.add_graph")
          if hasattr(model, 'forward'):
              # A valid PyTorch model should have a 'forward' method
              self._get_file_writer().add_graph(graph(model, input_to_model, verbose, use_strict_trace))
          else:
              # Caffe2 models do not have the 'forward' method
              from caffe2.proto import caffe2_pb2
              from caffe2.python import core
              from ._caffe2_graph import (
                  model_to_graph_def, nets_to_graph_def, protos_to_graph_def
              )
              if isinstance(model, list):
                  if isinstance(model[0], core.Net):
                      current_graph = nets_to_graph_def(model)
                  elif isinstance(model[0], caffe2_pb2.NetDef):
                      current_graph = protos_to_graph_def(model)
              else:
                  # Handles cnn.CNNModelHelper, model_helper.ModelHelper
                  current_graph = model_to_graph_def(model)
              event = event_pb2.Event(
                  graph_def=current_graph.SerializeToString())
              self._get_file_writer().add_event(event)
function_tokens: def add_graph ( self , model , input_to_model = None , verbose = False , use_strict_trace = True ) : torch . _C . _log_api_usage_once ( "tensorboard.logging.add_graph" ) if hasattr ( model , 'forward' ) : # A valid PyTorch model should have a 'forward' method self . _get_file_writer ( ) . add_graph ( graph ( model , input_to_model , verbose , use_strict_trace ) ) else : # Caffe2 models do not have the 'forward' method from caffe2 . proto import caffe2_pb2 from caffe2 . python import core from . _caffe2_graph import ( model_to_graph_def , nets_to_graph_def , protos_to_graph_def ) if isinstance ( model , list ) : if isinstance ( model [ 0 ] , core . Net ) : current_graph = nets_to_graph_def ( model ) elif isinstance ( model [ 0 ] , caffe2_pb2 . NetDef ) : current_graph = protos_to_graph_def ( model ) else : # Handles cnn.CNNModelHelper, model_helper.ModelHelper current_graph = model_to_graph_def ( model ) event = event_pb2 . Event ( graph_def = current_graph . SerializeToString ( ) ) self . _get_file_writer ( ) . add_event ( event )