o
    ?e                     @   sP   d Z ddlZddlmZ ddlmZ ddlmZ edgdG dd	 d	eZ	dS )
zA cache for FileWriters.    N)ops)
FileWriter)	tf_exportzsummary.FileWriterCache)v1c                   @   s4   e Zd ZdZi Ze Zedd Z	edd Z
dS )FileWriterCachezPCache for file writers.

  This class caches file writers, one per directory.
  c                  C   sJ   t j t j D ]} |   q	i t _W d   dS 1 sw   Y  dS )zAClear cached summary writers. Currently only used for unit tests.N)r   _lock_cachevaluesclose)item r   n/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/summary/writer/writer_cache.pyclear$   s
   
"zFileWriterCache.clearc                 C   sT   t j | t jvrt| t dt j| < t j|  W  d   S 1 s#w   Y  dS )zReturns the FileWriter for the specified directory.

    Args:
      logdir: str, name of the directory.

    Returns:
      A `FileWriter`.
    )graphN)r   r   r   r   r   Zget_default_graph)Zlogdirr   r   r   get.   s   

$zFileWriterCache.getN)__name__
__module____qualname____doc__r   	threadingRLockr   staticmethodr   r   r   r   r   r   r      s    
	r   )
r   r   Ztensorflow.python.frameworkr   Z'tensorflow.python.summary.writer.writerr   Z tensorflow.python.util.tf_exportr   objectr   r   r   r   r   <module>   s   
