ó
    6êbiŽ  ã                   ór   • S r SSKrSSKJs  Jr  SSKJr  SSKJ	r	  SSK
Jr  \" S5       " S S\5      5       rg)	zContains the Permute layer.é    N)ÚLayer)Ú	InputSpec)Úkeras_exportzkeras.layers.Permutec                   óD   ^ • \ rS rSrSrU 4S jrS rS rU 4S jrSr	U =r
$ )ÚPermuteé   a  Permutes the dimensions of the input according to a given pattern.

Useful e.g. connecting RNNs and convnets.

Example:

```python
model = Sequential()
model.add(Permute((2, 1), input_shape=(10, 64)))
# now: model.output_shape == (None, 64, 10)
# note: `None` is the batch dimension
```

Args:
  dims: Tuple of integers. Permutation pattern does not include the
    samples dimension. Indexing starts at 1.
    For instance, `(2, 1)` permutes the first and second dimensions
    of the input.

Input shape:
  Arbitrary. Use the keyword argument `input_shape`
  (tuple of integers, does not include the samples axis)
  when using this layer as the first layer in a model.

Output shape:
  Same as the input shape, but with the dimensions re-ordered according
  to the specified pattern.
c           	      ó  >• [         TU ]  " S0 UD6  [        U5      U l        [	        U5      [        [        S[        U5      S-   5      5      :w  a  [        SU 35      e[        [        U R                  5      S-   S9U l
        g )Né   zˆInvalid permutation argument `dims` for Permute Layer. The set of indices in `dims` must be consecutive and start from 1. Received dims=)Úndim© )ÚsuperÚ__init__ÚtupleÚdimsÚsortedÚlistÚrangeÚlenÚ
ValueErrorr   Ú
input_spec)Úselfr   ÚkwargsÚ	__class__s      €Ú_/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/layers/reshaping/permute.pyr   ÚPermute.__init__<   su   ø€ Ü‰ÒÑ"˜6Ò"Ü˜$“KˆŒ	Ü$‹<œ4¤ a¬¨T«°Q©Ó 7Ó8Ó8Üð)à)-¨ð0óð ô
 $¬¨T¯Y©Y«¸!Ñ);Ñ<ˆó    c                 óô   • [         R                  " U5      R                  5       n[        R                  " U5      n[	        U R
                  5       H  u  p4X   nXRUS-   '   M     [         R                  " U5      $ )Nr
   )ÚtfÚTensorShapeÚas_listÚcopyÚ	enumerater   )r   Úinput_shapeÚoutput_shapeÚiÚdimÚ
target_dims         r   Úcompute_output_shapeÚPermute.compute_output_shapeG   sa   € Ü—n’n [Ó1×9Ñ9Ó;ˆÜ—y’y Ó-ˆÜ §	¡	Ö*‰FˆAØ$Ñ)ˆJØ",˜˜Q™Óñ +ô ~Š~˜lÓ+Ð+r   c                 óF   • [         R                  " USU R                  -   S9$ )N)r   )Úperm)r   Ú	transposer   )r   Úinputss     r   ÚcallÚPermute.callO   s   € Ü|Š|˜F¨°·	±	Ñ)9Ñ:Ð:r   c                 ó´   >• SU R                   0n[        TU ]	  5       n[        [	        UR                  5       5      [	        UR                  5       5      -   5      $ )Nr   )r   r   Ú
get_configÚdictr   Úitems)r   ÚconfigÚbase_configr   s      €r   r1   ÚPermute.get_configR   sG   ø€ Ø˜$Ÿ)™)Ð$ˆÜ‘gÑ(Ó*ˆÜ”D˜×*Ñ*Ó,Ó-´°V·\±\³^Ó0DÑDÓEÐEr   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r(   r.   r1   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s#   ø† ñõ:	=ò,ò;÷Fó Fr   r   )r;   r!   Útensorflow.compat.v2ÚcompatÚv2r   Útf_keras.src.engine.base_layerr   Útf_keras.src.engine.input_specr   Ú tensorflow.python.util.tf_exportr   r   r   r   r   Ú<module>rD      sD   ðñ "ó ç !Ð !å 0Ý 4õ :ñ Ð$Ó%ô7Fˆeó 7Fó &ñ7Fr   