a
    /SicÄo  ã                   @   s    d Z ddlZddlZddlZddlZddlmZ ddlmZ G dd„ de 	dd¡ƒZ
G dd	„ d	e 	d	d
¡ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z@Timeline visualization for TensorFlow using Chrome Trace Format.é    N)Ú
build_info)Ú
tf_loggingc                   @   s   e Zd ZdZdS )ÚAllocationMaximuma  Stores the maximum allocation for a given allocator within the timelne.

  Parameters:
    timestamp: `tensorflow::Env::NowMicros()` when this maximum was reached.
    num_bytes: the total memory used at this time.
    tensors: the set of tensors allocated at this time.
  N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   ú]/var/www/html/django/DPS/env/lib/python3.9/site-packages/tensorflow/python/client/timeline.pyr      s   r   ©Ú	timestampÚ	num_bytesÚtensorsc                   @   s   e Zd ZdZdS )ÚStepStatsAnalysiszÄStores the step stats analysis output.

  Parameters:
    chrome_trace: A dict containing the chrome trace analysis.
    allocator_maximums: A dict mapping allocator names to AllocationMaximum.
  Nr   r
   r
   r
   r   r   )   s   r   ©Úchrome_traceZallocator_maximumsc                   @   s|   e Zd ZdZddd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zddd„ZdS ) Ú_ChromeTraceFormatterz<A helper class for generating traces in Chrome Trace Format.Fc                 C   s   || _ g | _g | _dS )z(Constructs a new Chrome Trace formatter.N)Ú_show_memoryÚ_eventsÚ	_metadata)ÚselfÚshow_memoryr
   r
   r   Ú__init__7   s    z_ChromeTraceFormatter.__init__c                 C   s8   i }||d< ||d< ||d< ||d< ||d< ||d< |S )aH  Creates a new Chrome Trace event.

    For details of the file format, see:
    https://github.com/catapult-project/catapult/blob/master/tracing/README.md

    Args:
      ph:  The type of event - usually a single character.
      category: The event category as a string.
      name:  The event name as a string.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      timestamp:  The timestamp of this event as a long integer.

    Returns:
      A JSON compatible event object.
    ÚphÚcatÚnameÚpidÚtidÚtsr
   )r   r   Úcategoryr   r   r   r   Úeventr
   r
   r   Ú_create_event=   s    z#_ChromeTraceFormatter._create_eventc                 C   s8   i }d|d< d|d< ||d< d|i|d< | j  |¡ dS )z›Adds a process metadata event to the trace.

    Args:
      name:  The process name as a string.
      pid:  Identifier of the process as an integer.
    Zprocess_namer   ÚMr   r   ÚargsN©r   Úappend)r   r   r   r!   r
   r
   r   Úemit_pidW   s    z_ChromeTraceFormatter.emit_pidc                 C   s@   i }d|d< d|d< ||d< ||d< d|i|d< | j  |¡ dS )	zÍAdds a thread metadata event to the trace.

    Args:
      name:  The thread name as a string.
      pid:  Identifier of the process as an integer.
      tid:  Identifier of the thread as an integer.
    Úthread_namer   r#   r   r   r   r$   Nr%   )r   r   r   r   r!   r
   r
   r   Úemit_tide   s    z_ChromeTraceFormatter.emit_tidc           	      C   s4   |   d|||||¡}||d< ||d< | j |¡ dS )aå  Adds a region event to the trace.

    Args:
      timestamp:  The start timestamp of this region as a long integer.
      duration:  The duration of this region as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      category: The event category as a string.
      name:  The event name as a string.
      args:  A JSON-compatible dictionary of event arguments.
    ÚXZdurr$   N©r"   r   r&   )	r   r   Údurationr   r   r    r   r$   r!   r
   r
   r   Úemit_regionu   s    z!_ChromeTraceFormatter.emit_regionc                 C   s,   |   d|||||¡}||d< | j |¡ dS )a£  Adds an object creation event to the trace.

    Args:
      category: The event category as a string.
      name:  The event name as a string.
      timestamp:  The timestamp of this event as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      object_id: Identifier of the object as an integer.
    ÚNÚidNr+   ©r   r    r   r   r   r   Ú	object_idr!   r
   r
   r   Úemit_obj_create†   s    z%_ChromeTraceFormatter.emit_obj_createc                 C   s,   |   d|||||¡}||d< | j |¡ dS )a£  Adds an object deletion event to the trace.

    Args:
      category: The event category as a string.
      name:  The event name as a string.
      timestamp:  The timestamp of this event as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      object_id: Identifier of the object as an integer.
    ÚDr/   Nr+   r0   r
   r
   r   Úemit_obj_delete•   s    z%_ChromeTraceFormatter.emit_obj_deletec           	      C   s8   |   d|||||¡}||d< d|i|d< | j |¡ dS )aä  Adds an object snapshot event to the trace.

    Args:
      category: The event category as a string.
      name:  The event name as a string.
      timestamp:  The timestamp of this event as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      object_id: Identifier of the object as an integer.
      snapshot:  A JSON-compatible representation of the object.
    ÚOr/   Úsnapshotr$   Nr+   )	r   r    r   r   r   r   r1   r6   r!   r
   r
   r   Úemit_obj_snapshot¤   s    z'_ChromeTraceFormatter.emit_obj_snapshotc                 C   s,   |   dd||||¡}||d< | j |¡ dS )a  Adds a flow start event to the trace.

    When matched with a flow end event (with the same 'flow_id') this will
    cause the trace viewer to draw an arrow between the start and end events.

    Args:
      name:  The event name as a string.
      timestamp:  The timestamp of this event as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      flow_id: Identifier of the flow as an integer.
    ÚsÚDataFlowr/   Nr+   ©r   r   r   r   r   Úflow_idr!   r
   r
   r   Úemit_flow_start¶   s    z%_ChromeTraceFormatter.emit_flow_startc                 C   s,   |   dd||||¡}||d< | j |¡ dS )a  Adds a flow end event to the trace.

    When matched with a flow start event (with the same 'flow_id') this will
    cause the trace viewer to draw an arrow between the start and end events.

    Args:
      name:  The event name as a string.
      timestamp:  The timestamp of this event as a long integer.
      pid:  Identifier of the process generating this event as an integer.
      tid:  Identifier of the thread generating this event as an integer.
      flow_id: Identifier of the flow as an integer.
    Útr9   r/   Nr+   r:   r
   r
   r   Úemit_flow_endÇ   s    z#_ChromeTraceFormatter.emit_flow_endc                 C   s0   |   d|||d|¡}||i|d< | j |¡ dS )a{  Emits a record for a single counter.

    Args:
      category: The event category as a string.
      name:  The event name as a string.
      pid:  Identifier of the process generating this event as an integer.
      timestamp:  The timestamp of this event as a long integer.
      counter: Name of the counter as a string.
      value:  Value of the counter as an integer.
    ÚCr   r$   Nr+   )r   r    r   r   r   ÚcounterÚvaluer!   r
   r
   r   Úemit_counterØ   s    z"_ChromeTraceFormatter.emit_counterc                 C   s0   |   d|||d|¡}| ¡ |d< | j |¡ dS )aX  Emits a counter record for the dictionary 'counters'.

    Args:
      category: The event category as a string.
      name:  The event name as a string.
      pid:  Identifier of the process generating this event as an integer.
      timestamp:  The timestamp of this event as a long integer.
      counters: Dictionary of counter values.
    r?   r   r$   N)r"   Úcopyr   r&   )r   r    r   r   r   Úcountersr!   r
   r
   r   Úemit_countersç   s    
z#_ChromeTraceFormatter.emit_countersc                 C   s:   i }| j | j |d< |r(tj|dddS tj|ddS dS )zÁFormats the chrome trace to a string.

    Args:
      pretty: (Optional.)  If True, produce human-readable JSON output.

    Returns:
      A JSON-formatted string in Chrome Trace format.
    ZtraceEventsé   )ú,z: )ÚindentÚ
separators)rG   ú:)rI   N)r   r   ÚjsonÚdumps)r   ÚprettyÚtracer
   r
   r   Úformat_to_stringõ   s
    	z&_ChromeTraceFormatter.format_to_stringN)F)F)r   r   r   r	   r   r"   r'   r)   r-   r2   r4   r7   r<   r>   rB   rE   rO   r
   r
   r
   r   r   4   s   
r   c                   @   s|   e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZdd„ Zdd„ ZdS )Ú_TensorTrackerz4An internal class to track the lifetime of a Tensor.c                 C   s4   || _ || _|| _|| _|| _|| _g | _g | _dS )ak  Creates an object to track tensor references.

    This class is not thread safe and is intended only for internal use by
    the 'Timeline' class in this file.

    Args:
      name:  The name of the Tensor as a string.
      object_id:  Chrome Trace object identifier assigned for this Tensor.
      timestamp:  The creation timestamp of this event as a long integer.
      pid:  Process identifier of the associated device, as an integer.
      allocator:  Name of the allocator used to create the Tensor.
      num_bytes:  Number of bytes allocated (long integer).

    Returns:
      A 'TensorTracker' object.
    N)Ú_nameÚ_pidÚ
_object_idÚ_create_timeÚ
_allocatorÚ
_num_bytesÚ
_ref_timesÚ_unref_times)r   r   r1   r   r   Ú	allocatorr   r
   r
   r   r   	  s    z_TensorTracker.__init__c                 C   s   | j S )zName of this tensor.)rQ   ©r   r
   r
   r   r   #  s    z_TensorTracker.namec                 C   s   | j S )z9ID of the process which created this tensor (an integer).)rR   rZ   r
   r
   r   r   (  s    z_TensorTracker.pidc                 C   s   | j S )z6Timestamp when this tensor was created (long integer).)rT   rZ   r
   r
   r   Úcreate_time-  s    z_TensorTracker.create_timec                 C   s   | j S )z7Returns the object identifier of this tensor (integer).)rS   rZ   r
   r
   r   r1   2  s    z_TensorTracker.object_idc                 C   s   | j S )z,Size of this tensor in bytes (long integer).)rV   rZ   r
   r
   r   r   7  s    z_TensorTracker.num_bytesc                 C   s   | j S )z:Name of the allocator used to create this tensor (string).)rU   rZ   r
   r
   r   rY   <  s    z_TensorTracker.allocatorc                 C   s
   t | jƒS )z9Last unreference timestamp of this tensor (long integer).)ÚmaxrX   rZ   r
   r
   r   Ú
last_unrefA  s    z_TensorTracker.last_unrefc                 C   s   | j  |¡ dS )zŒAdds a reference to this tensor with the specified timestamp.

    Args:
      timestamp:  Timestamp of object reference as an integer.
    N)rW   r&   ©r   r   r
   r
   r   Úadd_refF  s    z_TensorTracker.add_refc                 C   s   | j  |¡ dS )z‹Adds an unref to this tensor with the specified timestamp.

    Args:
      timestamp:  Timestamp of object unreference as an integer.
    N)rX   r&   r^   r
   r
   r   Ú	add_unrefN  s    z_TensorTracker.add_unrefN)r   r   r   r	   r   Úpropertyr   r   r[   r1   r   rY   r]   r_   r`   r
   r
   r
   r   rP     s$   






rP   c                   @   sž   e Zd ZdZd(dd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd)d#d$„Zd*d&d'„ZdS )+ÚTimelinez@A class for visualizing execution timelines of TensorFlow steps.Nc                 C   sN   || _ d| _|| _tƒ | _d| _i | _i | _i | _d| _	i | _
i | _i | _dS )a}  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 'StepStats' proto recording execution times.
      graph: (Optional) The 'Graph' that was executed.
    Nr   )Ú_origin_step_statsÚ_step_statsÚ_graphr   Ú_chrome_traceÚ	_next_pidÚ_device_pidsÚ_tensor_pidsÚ_tensorsÚ_next_flow_idÚ_flow_startsZ_alloc_timesÚ_allocator_maximums)r   Ú
step_statsÚgraphr
   r
   r   r   Z  s    zTimeline.__init__c                 C   s   | j }|  j d7  _ |S )zAllocate a process Id.é   )rg   )r   r   r
   r
   r   Ú
_alloc_pidt  s    zTimeline._alloc_pidc                 C   s   | j }|  j d7  _ |S )zAllocate a flow Id.rp   )rk   )r   r;   r
   r
   r   Ú_alloc_flow_idz  s    zTimeline._alloc_flow_idc                 C   sJ   t  d|¡}|du rddg fS | ¡ \}}}|s6g }n
| d¡}|||fS )ú+Parses the fields in a node timeline label.z(.*) = (.*)\((.*)\)NÚunknownz, )ÚreÚmatchÚgroupsÚsplit)r   Úlabelrv   ÚnnÚopÚinputsr
   r
   r   Ú_parse_op_label€  s    

zTimeline._parse_op_labelc                 C   sh   |  d¡}|  d¡}|dkr@|dkr@|d |k r@||d |… }| d¡dg }|dd… \}}||fS )rs   ú@@ú#r   é   rJ   rt   N)Úfindrx   )r   ry   Ú	node_nameÚstartÚendÚfieldsr   r{   r
   r
   r   Ú_parse_kernel_label  s    

zTimeline._parse_kernel_labelc                 C   s„   | j jD ]v}dg}|jD ]d}d}t|ƒD ]*\}}|j|kr(|}|j|j ||<  qTq(|dk rvt|ƒ}| |j|j ¡ ||_qqdS )z@Assigns non-overlapping lanes for the activities on each device.r   éÿÿÿÿN)	rd   Ú	dev_statsÚ
node_statsÚ	enumerateÚall_start_microsÚall_end_rel_microsÚlenr&   Ú	thread_id)r   Zdevice_statsZlanesÚnsÚlÚiZltsr
   r
   r   Ú_assign_lanes™  s    

zTimeline._assign_lanesc              	   C   s¶   |j }|j}|j}|j}g }|r4|  |j|¡\}}	n |dkrBd}	n|  |j¡\}
}	}||	dœ}tjd r||j d¡d |d< t	|ƒD ]\}}||d| < q„| j
 ||||d|	|¡ d	S )
a  Generates a Chrome Trace event to show Op execution.

    Args:
      nodestats: The 'NodeExecStats' proto recording op execution.
      pid: The pid assigned for the device where this op ran.
      is_gputrace: If True then this op came from the GPUTracer.
    Ú
RecvTensor)r   r{   Úis_rocm_buildr~   r   Úkernelzinput%dÚOpN)r‚   r‹   rŒ   rŽ   r†   Útimeline_labelr}   r   rx   rŠ   rf   r-   )r   Z	nodestatsr   Úis_gputracer‚   rƒ   r,   r   r|   r{   Ú_r$   r‘   Zinamer
   r
   r   Ú_emit_opª  s$    ÿ


zTimeline._emit_opc              	   C   s:   t |jƒ dd¡}d|i}| j d|j||||j|¡ dS )as  Generate Chrome Trace snapshot event for a computed Tensor.

    Args:
      tensor: A 'TensorTracker' object.
      timestamp:  The timestamp of this snapshot as a long integer.
      pid: The pid assigned for showing the device where this op ran.
      tid: The tid of the thread computing the tensor snapshot.
      value: A JSON-compliant snapshot of the object.
    ú"Ú Útensor_descriptionÚTensorN)Ústrr   Úreplacerf   r7   r   r1   )r   Útensorr   r   r   rA   Údescr6   r
   r
   r   Ú_emit_tensor_snapshotÆ  s
    
ÿzTimeline._emit_tensor_snapshotc                 C   s*   t | jƒ}t||||||ƒ}|| j|< |S )N)r   rj   rP   )r   r   r   Útensors_pidrY   r   r1   r¡   r
   r
   r   Ú_produce_tensorÕ  s    
ÿ
zTimeline._produce_tensorc                 C   s   d|v pd|v S )z=Returns true if this device is part of the GPUTracer logging.z/stream:z/memcpyr
   )r   Údevice_namer
   r
   r   Ú_is_gputrace_deviceÜ  s    zTimeline._is_gputrace_devicec                 C   s|   |   ¡ | _| j d| j¡ | jjD ]T}|   ¡ }|| j|j< |   ¡ }|| j|j< | j |jd |¡ | j |jd |¡ q"dS )z;Allocate fake process ids for each device in the StepStats.Z
Allocatorsz Computez TensorsN)	rq   Ú_allocators_pidrf   r'   rd   rˆ   rh   Údeviceri   )r   rˆ   Ú
device_pidr¤   r
   r
   r   Ú_allocate_pidsà  s    
zTimeline._allocate_pidsc                 C   sú   | j jD ]ì}| j|j }| j|j }|jD ]È}|j}|j}|j}|j|j	 }	t
|jƒD ]š\}
}|
rpd||
f }n|}|jj}|j}|j}|  |||||¡}| |¡ | |	¡ |	||f| j|< |rV| j d|||||j¡ |  ||	d |||¡ qVq*qdS )z,Analyze tensor references to track dataflow.z%s:%drž   rp   N)rd   rˆ   rh   r©   ri   r‰   rŽ   r‚   r‹   rŒ   rŠ   Úoutputr   Úallocation_descriptionÚrequested_bytesÚallocator_namer¥   r_   r`   rl   rf   r2   r1   r£   )r   r   rˆ   rª   r¤   r‰   r   r‚   Ú
start_timeÚend_timeÚindexr¬   Zoutput_nameÚ
allocationr   r¯   r¡   r
   r
   r   Ú_analyze_tensorsî  s:    

ÿ


þÿzTimeline._analyze_tensorsc              
   C   sN  | j jD ]>}|j}| j| }|  |¡}|jD ]}|j}|j}|j|j }	|  	|||¡ |s.|j
dkrjq.|  |j¡\}
}
}|D ]Ä}|| jvr¬| d¡}|dkr¬|d|… }|| jv r6| j| }| |¡ | |	d ¡ |rD| j| \}}}||ks||krD|  ¡ }| j |||||¡ | j |||||¡ q€t dd|¡ q€q.qdS )z#Visualize the computation activity.r“   z/_r   Nrp   z&Can't find tensor %s - removed by CSE?)rd   rˆ   r©   rh   r§   r‰   rŽ   r‹   rŒ   rš   r‚   r}   r—   rj   Úrfindr_   r`   rl   rr   rf   r<   r>   ÚloggingÚvlog)r   Úshow_dataflowrˆ   r¦   rª   r˜   r‰   r   r°   r±   r™   r|   Ú
input_namer²   r¡   r[   Z
create_pidZ
create_tidr;   r
   r
   r   Ú_show_compute  sJ    





ÿ

þ
ÿÿzTimeline._show_computec              
   C   sH  i }| j D ]t}| j | }| j d||j|jd|j¡ |j}||vrJg ||< |j}||  |j	||f¡ ||  |j| |f¡ q
i }|D ]´}|| }| 
¡  d}tƒ }	tddtƒ d||< t|dd„ dD ]p\}
}}||7 }|dk rð|	 |¡ n
|	 |¡ ||| jkr"t|
|t |	¡d||< | j d|| j|
||¡ qÊqˆ|| _dS )	z3Produce a counter series for each memory allocator.rž   r   r   c                 S   s   | d S )Nr   r
   )r³   r
   r
   r   Ú<lambda>[  ó    z0Timeline._show_memory_counters.<locals>.<lambda>)ÚkeyZMemoryN)rj   rf   r4   r]   r   r1   rY   r   r&   r[   ÚsortÚsetr   ÚsortedÚdiscardÚaddrC   ÚdeepcopyrB   r¨   rm   )r   Zallocationsr   r¡   rY   r   Zalloc_maxesZ
alloc_listÚtotal_bytesZalloc_tensor_setÚtimer
   r
   r   Ú_show_memory_counters?  sN    


ÿÿ
ÿ
ý

þzTimeline._show_memory_countersc                 C   sB  |dkr| j | _dS t | j ¡| _g }g }| jjD ].}d|jv rL| |¡ q2d|jv r2| |¡ q2i }i }|D ]t}|jD ]h}|  |j	|j
¡\}}	|j}
|j|j }||v rÐt|| |
ƒ||< t|| |ƒ||< qx|
||< |||< qxqn|D ]T}|jD ]H}|j
|v ròt||j
 |j|j ƒ}|dkr.||j
 |_||j |_qòqèdS )a?  Update the start and end time of ops in step stats.

    Args:
    op_time: How the execution time of op is shown in timeline. Possible values
      are "schedule", "gpu" and "all". "schedule" will show op from the time it
      is scheduled to the end of the scheduling. Notice by the end of its
      scheduling its async kernels may not start yet. It is shown using the
      default value from step_stats. "gpu" will show op with the execution time
      of its kernels on GPU. "all" will show op from the start of its scheduling
      to the end of its last kernel.
    ÚscheduleNz/stream:allz/jobÚgpu)rc   rd   rC   rÃ   rˆ   r©   r&   r‰   r†   r—   r‚   r‹   rŒ   Úminr\   )r   Úop_timeZstream_all_statsZ	job_statsÚstatsZop_gpu_startZ
op_gpu_endr•   r   r™   rƒ   r„   r{   r
   r
   r   Ú_preprocess_op_timem  sD    


ÿ



ÿ
zTimeline._preprocess_op_timeTrÇ   c                 C   sJ   |   |¡ |  ¡  |  ¡  |  |¡ |  |¡ |r:|  ¡  t| j| jdS )a˜  Analyze the step stats and format it into Chrome Trace Format.

    Args:
      show_dataflow: (Optional.) If True, add flow events to the trace
        connecting producers and consumers of tensors.
      show_memory: (Optional.) If True, add object snapshot events to the trace
        showing the sizes and lifetimes of tensors.
      op_time: (Optional.) How the execution time of op is shown in timeline.
        Possible values are "schedule", "gpu" and "all". "schedule" will show op
        from the time it is scheduled to the end of the scheduling. Notice by
        the end of its scheduling its async kernels may not start yet. It is
        shown using the default value from step_stats. "gpu" will show op with
        the execution time of its kernels on GPU. "all" will show op from the
        start of its scheduling to the end of its last kernel.

    Returns:
      A 'StepStatsAnalysis' object.
    r   )	rÌ   r«   r’   r´   rº   rÆ   r   rf   rm   )r   r¸   r   rÊ   r
   r
   r   Úanalyze_step_stats¡  s    


þzTimeline.analyze_step_statsFc                 C   s   | j |||d}|jjddS )a¬  Produces a trace in Chrome Trace Format.

    Args:
      show_dataflow: (Optional.) If True, add flow events to the trace
        connecting producers and consumers of tensors.
      show_memory: (Optional.) If True, add object snapshot events to the trace
        showing the sizes and lifetimes of tensors.
      op_time: (Optional.) How the execution time of op is shown in timeline.
        Possible values are "schedule", "gpu" and "all".
        "schedule" will show op from the time it is scheduled to the end of
          the scheduling.
          Notice by the end of its scheduling its async kernels may not start
          yet. It is shown using the default value from step_stats.
        "gpu" will show op with the execution time of its kernels on GPU.
        "all" will show op from the start of its scheduling to the end of
          its last kernel.

    Returns:
      A JSON formatted string in Chrome Trace format.
    )r¸   r   rÊ   T)rM   )rÍ   r   rO   )r   r¸   r   rÊ   Zstep_stats_analysisr
   r
   r   Úgenerate_chrome_trace_formatÂ  s    ÿz%Timeline.generate_chrome_trace_format)N)TTrÇ   )TFrÇ   )r   r   r   r	   r   rq   rr   r}   r†   r’   rš   r£   r¥   r§   r«   r´   rº   rÆ   rÌ   rÍ   rÎ   r
   r
   r
   r   rb   W  s0   
 1.5   ý
"   ýrb   )r	   ÚcollectionsrC   rK   ru   Útensorflow.python.platformr   r   r¶   Ú
namedtupler   r   Úobjectr   rP   rb   r
   r
   r
   r   Ú<module>   s    ÿÿ SQ