
    BVh                     d    d Z ddlZddlmZ ddlmZ ddlmZ  edg       G d d	e             Z	y)
zA cache for FileWriters.    N)ops)
FileWriter)	tf_exportzsummary.FileWriterCache)v1c                   V    e Zd ZdZi Z ej                         Zed        Z	ed        Z
y)FileWriterCachezPCache for file writers.

  This class caches file writers, one per directory.
  c                      t         j                  5  t         j                  j                         D ]  } | j	                           i t         _        ddd       y# 1 sw Y   yxY w)zAClear cached summary writers. Currently only used for unit tests.N)r   _lock_cachevaluesclose)items    ]/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/summary/writer/writer_cache.pyclearzFileWriterCache.clear$   sS     
		 " "((//1 $

!o" " "s   ?AA"c                     t         j                  5  | t         j                  vr0t        | t	        j
                               t         j                  | <   t         j                  |    cddd       S # 1 sw Y   yxY w)zReturns the FileWriter for the specified directory.

    Args:
      logdir: str, name of the directory.

    Returns:
      A `FileWriter`.
    )graphN)r   r
   r   r   r   get_default_graph)logdirs    r   getzFileWriterCache.get.   sa     
		 ,	--	-)3#//1*3v&##F+	, , ,s   AA00A9N)__name__
__module____qualname____doc__r   	threadingRLockr
   staticmethodr   r        r   r   r      sD    
 & )//
%" " , ,r   r   )
r   r   tensorflow.python.frameworkr   'tensorflow.python.summary.writer.writerr    tensorflow.python.util.tf_exportr   objectr   r   r   r   <module>r#      s:      + > 6 ()*#,f #, +#,r   