class_docstr: A class for visualizing execution timelines of TensorFlow steps.
class_docstr_tok: ["A","class","for","visualizing","execution","timelines","of","TensorFlow","steps","."]
docstr: Constructs a new Timeline.
  
  A 'Timeline' is used for visualizing the execution of a TensorFlow
  computation.  It shows the timings and concurrency of execution at
  the granularity of TensorFlow Ops.
  This class is not thread safe.
  
  Args:
    step_stats: The 'step_stats_pb2.StepStats' proto recording execution
      times.
    graph: (Optional) The 'Graph' that was executed.
docstr_tok: ["Constructs","a","new","Timeline",".","A","'Timeline","'","is","used","for","visualizing","the","execution","of","a","TensorFlow","computation",".","It","shows","the","timings","and","concurrency","of","execution","at","the","granularity","of","TensorFlow","Ops",".","This","class","is","not","thread","safe",".","Args",":","step_stats",":","The","'step_stats_pb2.StepStats","'","proto","recording","execution","times",".","graph",":","(","Optional",")","The","'Graph","'","that","was","executed","."]
code: def __init__(
      self,
      step_stats: step_stats_pb2.StepStats,
      graph: Optional[Any] = None,
  ) -> None:
      """Constructs a new Timeline.
  
      A 'Timeline' is used for visualizing the execution of a TensorFlow
      computation.  It shows the timings and concurrency of execution at
      the granularity of TensorFlow Ops.
      This class is not thread safe.
  
      Args:
        step_stats: The 'step_stats_pb2.StepStats' proto recording execution
          times.
        graph: (Optional) The 'Graph' that was executed.
      """
  
      self._origin_step_stats = step_stats
      self._step_stats = None
      self._graph = graph
      self._chrome_trace = _ChromeTraceFormatter()
      self._next_pid = 0
      self._device_pids = {}  # device name -> pid for compute activity.
      self._tensor_pids = {}  # device name -> pid for tensors.
      self._tensors = {}  # tensor_name -> TensorTracker
      self._next_flow_id = 0
      self._flow_starts = {}  # tensor_name -> (timestamp, pid, tid)
      self._alloc_times = {}  # tensor_name -> ( time, allocator, size )
      self._allocator_maximums = {}
  
imports: import collections
  import copy
  import json
  import re
  from typing import Any, Dict, List, Optional, Tuple, Union
  from tensorflow.core.framework import step_stats_pb2
  from tensorflow.python.platform import build_info
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 1 to create a new Timeline object from inherited base classes: object with example: obj = Timeline(step_stats, graph)