+
    Pj                         R t ^ RIHtHtHt ^ RIt^ RIHt ^RI	H
t
Ht ^RIHt Rt ! R R]
]4      t ! R	 R
]]4      t ! R R]]4      tR# )aj  
Comment about tensorflow layers:
unfortunately instructions on creation of TF layers change constantly,
and changed way too many times at this point to remember what-compatible-where.

Layers in einops==0.7.0 (and several prior versions)
 are compatible with TF 2.13

Layers in einops==0.8.0 were re-implemented
 according to official instructions for TF 2.16

)DictOptionalcastN)Layer)RearrangeMixinReduceMixin)_EinmixMixinzAlex Rogozhnikovc                   2   a  ] tR t^t o R tR tR tRtV tR# )	Rearrangec                    R # N selfinput_shapes   &&q/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/einops/layers/tensorflow.pybuildRearrange.build           c                $    V P                  V4      # r   _apply_reciper   inputss   &&r   callRearrange.call       !!&))r   c                6    R V P                   /V P                  C# )pattern)r   axes_lengthsr   s   &r   
get_configRearrange.get_config    s    4<<=4+<+<==r   r   N	__name__
__module____qualname____firstlineno__r   r   r"   __static_attributes____classdictcell____classdict__s   @r   r
   r
      s     *> >r   r
   c                   2   a  ] tR t^$t o R tR tR tRtV tR# )Reducec                    R # r   r   r   s   &&r   r   Reduce.build%   r   r   c                $    V P                  V4      # r   r   r   s   &&r   r   Reduce.call(   r   r   c                N    R V P                   RV P                  /V P                  C# )r   	reduction)r   r4   r    r!   s   &r   r"   Reduce.get_config+   s$    4<<dnnZHYHYZZr   r   Nr$   r+   s   @r   r.   r.   $   s     *[ [r   r.   c                   J   a  ] tR t^/t o R tV 3R lR ltR tR tR tRt	V t
R# )	EinMixc                    WW4.V n         R # r   )_params)r   weight_shapeweight_bound
bias_shape
bias_bounds   &&&&&r   _create_parametersEinMix._create_parameters0   s     %JKr   c          	      r   < V ^8  d   QhRS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          /# )   pre_reshape_patternpre_reshape_lengthspost_reshape_patternpost_reshape_lengths)r   strr   )formatr,   s   "r   __annotate__EinMix.__annotate__5   sI     f f%c]f &d^f 'sm	f
 'tnfr   c                    R V n         Ve    \        V3/ \        \        V4      B V n         R V n        Ve"   \        V3/ \        \        V4      B V n        R # R # r   )pre_rearranger
   r   dictpost_rearrange)r   rB   rC   rD   rE   s   &&&&&r   _create_rearrange_layersEinMix._create_rearrange_layers5   s[     "*!*+>!b$tM`Ba!bD"+"+,@"eDOcDd"eD ,r   c                    V P                   w  r#rEV P                  V\        P                  ! V) V4      R R7      V n        Ve2   V P                  V\        P                  ! V) V4      R R7      V n        R# RV n        R# )T)shapeinitializer	trainableN)r9   
add_weighttfrandom_uniform_initializerweightbias)r   r   r:   r;   r<   r=   s   &&    r   r   EinMix.buildD   s{    ?C||<Zoo55|m\R & 
 ! 99:+zR ( DI DIr   c                   V P                   e   V P                  V4      p\        P                  ! V P                  WP                  4      pV P
                  e   W P
                  ,           pV P                  e   V P                  V4      pV# r   )rK   rU   einsumeinsum_patternrW   rX   rM   )r   r   results   && r   r   EinMix.callU   so    )''/F4..D99 ii'F*((0Fr   c                f    R V P                   RV P                  RV P                  /V P                  C# )r   r:   r<   )r   r:   r<   r    r!   s   &r   r"   EinMix.get_config_   s9    t||D--$//
 	
 	
r   )r9   rX   rM   rK   rW   N)r%   r&   r'   r(   r>   rN   r   r   r"   r)   r*   r+   s   @r   r7   r7   /   s+     L
f f"
 
r   r7   )__doc__typingr   r   r   
tensorflowrU   tensorflow.keras.layersr    r   r   _einmixr   
__author__r
   r.   r7   r   r   r   <module>rh      sO    ( '  ) ) !
> >[[% [6
\5 6
r   