o
    ®Ÿ?eã
  ã                   @   s@   d Z ddlZddlmZ ddlmZ edƒG dd„ deƒƒZdS )zTPU hardware feature info.é    N)Útopology_pb2)Ú	tf_exportz tpu.experimental.HardwareFeaturec                   @   sB   e Zd ZdZdd„ ZG dd„ dejƒZedd„ ƒZ	e
dd	„ ƒZd
S )ÚHardwareFeaturez/class holds all the feature info about the TPU.c                 C   s
   || _ dS )zŒStore TPU hardware feature info.

    Args:
      tpu_hardware_feature_proto: protobuf which describe the tpu hardware
        feature.
    N)Útpu_hardware_feature_proto)Úselfr   © r   úk/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/tpu/tpu_hardware_feature.pyÚ__init__   s   
zHardwareFeature.__init__c                   @   s   e Zd ZdZdZdZdZdS )z HardwareFeature.EmbeddingFeatureaô  Embedding feature flag strings.

    UNSUPPORTED: No embedding lookup accelerator available on the tpu.
    V1: Embedding lookup accelerator V1. The embedding lookup operation can only
        be placed at the beginning of computation. Only one instance of
        embedding
        lookup layer is allowed.
    V2: Embedding lookup accelerator V2. The embedding lookup operation can be
        placed anywhere of the computation. Multiple instances of embedding
        lookup layer is allowed.
    ÚUNSUPPORTEDÚV1ÚV2N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r   r   ÚEmbeddingFeature"   s
    r   c                 C   s>   t jjjtjjt jjjtjjt jjjtjji}| |tjj¡S )z3Convert the embedding feature proto to enum string.)r   ZTPUHardwareFeaturer   r
   r   r   r   Úget)ÚclsZembedding_feature_protoZ%embedding_feature_proto_to_string_mapr   r   r   Ú"_embedding_feature_proto_to_string2   s   úÿz2HardwareFeature._embedding_feature_proto_to_stringc                 C   s   t  | jj¡S )zITPU embedding feature.

    Returns:
      An EmbeddingFeature enum.
    )r   r   r   Úembedding_feature)r   r   r   r   r   @   s   ÿz!HardwareFeature.embedding_featureN)r   r   r   r   r	   ÚenumÚEnumr   Úclassmethodr   Úpropertyr   r   r   r   r   r      s    	
r   )r   r   Ztensorflow.core.protobuf.tpur   Z tensorflow.python.util.tf_exportr   Úobjectr   r   r   r   r   Ú<module>   s   