
    1Vh	                     ^    d Z ddlZddlmZ ddlmZ ddlmZ	 ddl
mZ ddl
mZ ddl
mZ d	 Zy)
zPublic API for the Embedding Projector.

@@ProjectorPluginAsset
@@ProjectorConfig
@@EmbeddingInfo
@@EmbeddingMetadata
@@SpriteMetadata
    N)text_format)tf)metadata)EmbeddingInfo)SpriteMetadata)ProjectorConfigc                 p     t         d fd               t        d      t        j                  |      }t        j
                  j                   t        j                        }t        j                  j                  j                  |d      5 }|j                  |       ddd       y# 1 sw Y   yxY w)a  Stores a config file used by the embedding projector.

    Args:
      logdir: Directory into which to store the config file, as a `str`.
        For compatibility, can also be a `tf.compat.v1.summary.FileWriter`
        object open at the desired logdir.
      config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig`
        proto that holds the configuration for the projector such as paths to
        checkpoint files and metadata files for the embeddings. If
        `config.model_checkpoint_path` is none, it defaults to the
        `logdir` used by the summary_writer.

    Raises:
      ValueError: If the summary writer does not have a `logdir`.
    
get_logdirc                       S )N )logdirs   V/home/dcms/DCMS/lib/python3.12/site-packages/tensorboard/plugins/projector/__init__.py<lambda>z&visualize_embeddings.<locals>.<lambda>:   s    6     Nz*Expected logdir to be a path, but got Nonew)getattr
ValueError_text_formatMessageToStringospathjoin	_metadataPROJECTOR_FILENAMEr   iogfileGFilewrite)r   configconfig_pbtxtr   fs   `    r   visualize_embeddingsr"   )   s    " ;WV\>:<F ~EFF  //7L77<<	 < <=D			4	% 	  s   B,,B5)__doc__r   google.protobufr   r   tensorboard.compatr   tensorboard.plugins.projectorr   r   2tensorboard.plugins.projector.projector_config_pb2r   r   r   r"   r   r   r   <module>r(      s,    
 7 ! ?
r   