
     Ti                    ^    S r SSKJr  SSKrSSKJr  SSKJr   " S S\R                  5      r	g)z0Class for storing metadata about the IR objects.    )annotationsN)Mapping)Anyc                  \   ^  \ rS rSrSrS	S
U 4S jjjrSS jrSS jrSS jrSS jr	Sr
U =r$ )MetadataStore   a  Class for storing metadata about the IR objects.

Metadata is stored as key-value pairs. The keys are strings and the values
can be any Python object.

The metadata store also supports marking keys as invalid. This is useful
when a pass wants to mark a key that needs to be recomputed.
c               B   > [         TU ]  U5        [        5       U l        g N)super__init__set_invalid_keys)selfdata	__class__s     P/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/onnx_ir/_metadata.pyr   MetadataStore.__init__   s    '*u    c                V    X R                   U'   U R                  R                  U5        g r
   )r   r   discard)r   keyitems      r   __setitem__MetadataStore.__setitem__   s!    		#""3'r   c                :    U R                   R                  U5        g r
   )r   addr   r   s     r   
invalidateMetadataStore.invalidate   s    s#r   c                    XR                   ;  $ )a.  Returns whether the value is valid.

Note that default values (None) are not necessarily invalid. For example,
a shape that is unknown (None) may be still valid if shape inference has
determined that the shape is unknown.

Whether a value is valid is solely determined by the user that sets the value.
r   r   s     r   is_validMetadataStore.is_valid!   s     ,,,,r   c                l    U R                   R                   SU R                  < SU R                  < S3$ )N(z, invalid_keys=))r   __name__r   r   )r   s    r   __repr__MetadataStore.__repr__,   s2    ..))*!DII=HZHZG]]^__r   r!   r
   )r   zMapping[str, Any] | NonereturnNone)r   strr   r   r*   r+   )r   r,   r*   r+   )r   r,   r*   bool)r*   r,   )r'   
__module____qualname____firstlineno____doc__r   r   r   r"   r(   __static_attributes____classcell__)r   s   @r   r   r      s-    - -($	-` `r   r   )
r1   
__future__r   collectionscollections.abcr   typingr   UserDictr    r   r   <module>r:      s*    7 "  # !`K(( !`r   