Ë
    Ÿ‘ijY  ã                   óB   — d Z ddlmZ ddlmZ ddlmZ  G d„ de«      Z	y)z&A python interface for Grappler items.é    )Úop_performance_data_pb2)Úmeta_graph_pb2)Ú_pywrap_tf_itemc                   óV   — e Zd ZdZ	 	 d
d„Zdd„Zd„ Zd„ Zed„ «       Z	ed„ «       Z
d„ Zy	)ÚItemzGrapplerItem.c                 óÄ   — || _         t        j                  «       | _        | j                  j	                  |«       || _        || _        d| _        | j                  «        y)a|  Creates an Item.

    Args:
      metagraph: a TensorFlow metagraph.
      ignore_colocation: if set, the tool will ignore all the colocation
        constraints generated by TensorFlow.
      ignore_user_placement: if set, all the placement annotations annotated in
        the metagraph will be ignored.
    Raises:
      ValueError: the metagraph is incomplete or invalid.
    N)	Ú
_metagraphr   ÚMetaGraphDefÚ_item_graphÚCopyFromÚ_ignore_colocationÚ_ignore_user_placementÚ_tf_itemÚ_BuildTFItem)ÚselfÚ	metagraphÚignore_colocationÚignore_user_placements       út/var/www/html/emotional.easysim.app/public_html/venv/lib/python3.12/site-packages/tensorflow/python/grappler/item.pyÚ__init__zItem.__init__   sS   € ð  €D„OÜ%×2Ñ2Ó4€DÔØ×Ñ×Ñ˜iÔ(Ø/€DÔØ"7€DÔØ€D„MØ×ÑÕó    c                 óB   — t        j                  | j                   |«      S ©N)Útf_itemÚTF_IdentifyImportantOps)r   Úsort_topologicallys     r   ÚIdentifyImportantOpszItem.IdentifyImportantOps0   s   € Ü×*Ñ*¨4¯<©<Ð9KÓLÐLr   c                 ó  — t        j                  | j                   «      }i }|j                  «       D ]K  \  }}g }|D ]:  }|j                  t        j
                  j                  j                  |«      «       Œ< |||<   ŒM |S )zGet Op properties.)r   ÚTF_GetOpPropertiesÚitemsÚappendr   ÚOpInfoÚTensorPropertiesÚ
FromString)r   ÚpropsÚ
propertiesÚkeyÚvaluesÚpropÚvalues          r   ÚGetOpPropertieszItem.GetOpProperties3   s†   € ä×&Ñ& t§|¡|Ó4€EØ€JØ—{‘{“}ò ‰ˆˆVØ€dØò Oˆ%ð 	�‰Ü#×*Ñ*×;Ñ;×FÑFÀuÓMõ	OðOð
 €j�‚oðð Ðr   c                 ó@   — t        j                  | j                   «      S )zÉReturn a list of hard colocation constraints.

    All the nodes in a colocation tuple must be placed on the same device for
    the model to work.

    Returns:
      A list of colocation tuples.
    )r   ÚTF_GetColocationGroups©r   s    r   ÚGetColocationGroupszItem.GetColocationGroupsA   s   € ô ×)Ñ)¨$¯,©,Ó7Ð7r   c                 ó   — | j                   S r   )r	   r.   s    r   r   zItem.metagraphL   s   € à�?‰?Ðr   c                 ó¶   — | j                   | j                  k7  r5| j                  «        | j                   j                  | j                  «       | j                  S r   )r   r	   r   r   r   r.   s    r   r   zItem.tf_itemP   sB   € à×Ñ˜4Ÿ?™?Ò*Ø
×ÑÔØ
×Ñ×Ñ §¡Ô0Ø�=‰=Ðr   c                 ó”   — t        j                  | j                  j                  «       | j                  | j
                  «      | _        y r   )r   Ú
TF_NewItemr	   ÚSerializeToStringr   r   r   r.   s    r   r   zItem._BuildTFItemW   s6   € Ü×&Ñ& t§¡×'HÑ'HÓ'JØ'+×'>Ñ'>Ø'+×'BÑ'BóD€D…Mr   N)TF)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r+   r/   Úpropertyr   r   r   © r   r   r   r      sP   „ Ùð "&Ø%*óó.Mòò	8ð ñó ðð ñó ðóDr   r   N)
r8   Útensorflow.core.grappler.costsr   Útensorflow.core.protobufr   Útensorflow.python.grapplerr   r   Úobjectr   r:   r   r   ú<module>r?      s#   ðñ -å BÝ 3Ý AôDDˆ6õ DDr   