+
    &j                     ^    ^ RI Ht ^ RIHt ^RIHt RR.t ! R R]4      t ! R R]4      tR# )	    Tensor)_size)ModuleFlatten	Unflattenc                   ~   a a ] tR t^t oRtRR.tRV3R lV 3R llltV3R lR ltV3R lR	 ltV3R
 lt	Rt
VtV ;t# )r   aS  
Flattens a contiguous range of dims into a tensor.

For use with :class:`~nn.Sequential`, see :meth:`torch.flatten` for details.

Shape:
    - Input: :math:`(*, S_{\text{start}},..., S_{i}, ..., S_{\text{end}}, *)`,'
      where :math:`S_{i}` is the size at dimension :math:`i` and :math:`*` means any
      number of dimensions including none.
    - Output: :math:`(*, \prod_{i=\text{start}}^{\text{end}} S_{i}, *)`.

Args:
    start_dim: first dim to flatten (default = 1).
    end_dim: last dim to flatten (default = -1).

Examples::
    >>> input = torch.randn(32, 1, 5, 5)
    >>> # With default parameters
    >>> m = nn.Flatten()
    >>> output = m(input)
    >>> output.size()
    torch.Size([32, 25])
    >>> # With non-default parameters
    >>> m = nn.Flatten(0, 2)
    >>> output = m(input)
    >>> output.size()
    torch.Size([160, 5])
	start_dimend_dimc                *   < V ^8  d   QhRS[ RS[ RR/# )   r
   r   returnNint)format__classdict__s   "p/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/nn/modules/flatten.py__annotate__Flatten.__annotate__.   s"      # C      c                <   < \         SV `  4        Wn        W n        R # )N)super__init__r
   r   )selfr
   r   	__class__s   &&&r   r   Flatten.__init__.   s    "r   c                &   < V ^8  d   QhRS[ RS[ /# r   inputr   r   )r   r   s   "r   r   r   3   s     ; ;V ; ;r   c                N    VP                  V P                  V P                  4      # z
Runs the forward pass.
)flattenr
   r   r   r   s   &&r   forwardFlatten.forward3   s     }}T^^T\\::r   c                    < V ^8  d   QhRS[ /# r   r   str)r   r   s   "r   r   r   9   s     E EC Er   c                :    RV P                    RV P                   2# )1
Returns the extra representation of the module.
z
start_dim=z
, end_dim=)r
   r   r   s   &r   
extra_reprFlatten.extra_repr9   s      DNN+:dll^DDr   c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   r
   r   r   )r   r   s   "r   r   r      s     > N? @ LA r   )r   r
   )   )__name__
__module____qualname____firstlineno____doc____constants__r   r$   r-   __annotate_func____static_attributes____classdictcell____classcell__r   r   s   @@r   r   r      s>     : !),M 
; ;E E[  r   c                      a a ] tR t^@t oRt]]]]3,          ,          tRR.t	V3R lV 3R llt
V3R lR ltV3R lR	 ltV3R
 lR ltV3R lR ltV3R ltRtVtV ;t# )r   a  
Unflattens a tensor dim expanding it to a desired shape. For use with :class:`~nn.Sequential`.

* :attr:`dim` specifies the dimension of the input tensor to be unflattened, and it can
  be either `int` or `str` when `Tensor` or `NamedTensor` is used, respectively.

* :attr:`unflattened_size` is the new shape of the unflattened dimension of the tensor and it can be
  a `tuple` of ints or a `list` of ints or `torch.Size` for `Tensor` input;  a `NamedShape`
  (tuple of `(name, size)` tuples) for `NamedTensor` input.

Shape:
    - Input: :math:`(*, S_{\text{dim}}, *)`, where :math:`S_{\text{dim}}` is the size at
      dimension :attr:`dim` and :math:`*` means any number of dimensions including none.
    - Output: :math:`(*, U_1, ..., U_n, *)`, where :math:`U` = :attr:`unflattened_size` and
      :math:`\prod_{i=1}^n U_i = S_{\text{dim}}`.

Args:
    dim (Union[int, str]): Dimension to be unflattened
    unflattened_size (Union[torch.Size, Tuple, List, NamedShape]): New shape of the unflattened dimension

Examples:
    >>> input = torch.randn(2, 50)
    >>> # With tuple of ints
    >>> m = nn.Sequential(
    >>>     nn.Linear(50, 50),
    >>>     nn.Unflatten(1, (2, 5, 5))
    >>> )
    >>> output = m(input)
    >>> output.size()
    torch.Size([2, 2, 5, 5])
    >>> # With torch.Size
    >>> m = nn.Sequential(
    >>>     nn.Linear(50, 50),
    >>>     nn.Unflatten(1, torch.Size([2, 5, 5]))
    >>> )
    >>> output = m(input)
    >>> output.size()
    torch.Size([2, 2, 5, 5])
    >>> # With namedshape (tuple of tuples)
    >>> input = torch.randn(2, 50, names=("N", "features"))
    >>> unflatten = nn.Unflatten("features", (("C", 2), ("H", 5), ("W", 5)))
    >>> output = unflatten(input)
    >>> output.size()
    torch.Size([2, 2, 5, 5])
dimunflattened_sizec                J   < V ^8  d   QhRS[ S[,          RS[S[,          RR/# )r   r>   r?   r   Nr   r)   r   
NamedShape)r   r   s   "r   r   Unflatten.__annotate__u   s,     1 1C#I 19K 1PT 1r   c                   < \         SV `  4        \        V\        4      '       d   V P	                  V4       M3\        V\
        4      '       d   V P                  V4       M\        R 4      hWn        W n	        R# )z'invalid argument type for dim parameterN)
r   r   
isinstancer   _require_tuple_intr)   _require_tuple_tuple	TypeErrorr>   r?   )r   r>   r?   r   s   &&&r   r   Unflatten.__init__u   s]    c3##$45S!!%%&67EFF 0r   c                   < V ^8  d   QhRR/# r   r   N )r   r   s   "r   r   rC      s     
 
T 
r   c                ,   \        V\        4      '       dX   \        V4       FF  w  r#\        V\        4      '       d   K  \        R R\	        V4      P
                   RV 2,           4      h	  R# \        RR\	        V4      P
                   2,           4      h)z*unflattened_size must be tuple of tuples, but found element of type  at pos Nz,unflattened_size must be a tuple of tuples, zbut found type )rE   tuple	enumeraterH   typer2   r   r   idxelems   &&  r   rG   Unflatten._require_tuple_tuple   s    eU##&u-	!$..#D6tDz7J7J6K8TWSXYZ  . :U 4 4567
 	
r   c                   < V ^8  d   QhRR/# rK   rL   )r   r   s   "r   r   rC      s     
 
4 
r   c                *   \        V\        \        34      '       dX   \        V4       FF  w  r#\        V\        4      '       d   K  \        R R\        V4      P                   RV 2,           4      h	  R# \        R\        V4      P                   24      h)z(unflattened_size must be tuple of ints, rN   rO   Nz9unflattened_size must be a tuple of ints, but found type )rE   rP   listrQ   r   rH   rR   r2   rS   s   &&  r   rF   Unflatten._require_tuple_int   s    eeT]++&u-	!$,,#B6tDz7J7J6K8TWSXYZ  . GUH\H\G]^
 	
r   c                &   < V ^8  d   QhRS[ RS[ /# r   r   )r   r   s   "r   r   rC      s     @ @V @ @r   c                N    VP                  V P                  V P                  4      # r!   )	unflattenr>   r?   r#   s   &&r   r$   Unflatten.forward   s     txx)>)>??r   c                    < V ^8  d   QhRS[ /# r'   r(   )r   r   s   "r   r   rC      s     K KC Kr   c                :    RV P                    RV P                   2# )r+   zdim=z, unflattened_size=r>   r?   r,   s   &r   r-   Unflatten.extra_repr   s#     dhhZ243H3H2IJJr   c                R   < V ^8  d   Qh/ S[ S[,          ;R&   S[S[,          ;R&   # )r   r>   r?   rA   )r   r   s   "r   r   rC   @   s+     d 
sNe f j((g r   ra   )r2   r3   r4   r5   r6   rP   r)   r   rB   r7   r   rG   rF   r$   r-   r8   r9   r:   r;   r<   s   @@r   r   r   @   sh     ,\ uS#X'J./M1 1
 

 
@ @K KG  r   N)	torchr   torch.typesr   moduler   __all__r   r   rL   r   r   <module>rh      s;       k
"1Ef 1EhgK gKr   