
    i                     ^    S SK Jr  S SKJr  S SKrS SKJr  S SKJrJ	r	  \ " S S5      5       r
g)    )	dataclass)ListN)
ScalarType)dim_order_from_stridescalar_type_enumc                   p    \ rS rSr% \\S'   \\   \S'   \\   \S'   \S\	R                  SS 4S j5       rSrg	)
TensorLayout   scalar_typesizes	dim_ordertensorreturnc           
      B   UR                  [        R                  S9(       d-  UR                  [        R                  S9(       d  [	        S5      e[        [        UR                  5      [        UR                  5      [        [        UR                  5       5      5      S9$ )N)memory_formatzUTensor is not contiguous. Please call .contiguous() before creating the TensorLayout.)r   r   r   )is_contiguoustorchcontiguous_formatchannels_last
ValueErrorr	   r   dtypelistshaper   stride)clsr   s     \/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/exir/tensor_layout.pyfrom_tensorTensorLayout.from_tensor   s}       u/F/F G##%2E2E#Fg  (6v||$0AB
 	
     N)__name__
__module____qualname____firstlineno__r   __annotations__r   intclassmethodr   Tensorr   __static_attributes__r    r   r   r	   r	      s@    9Cy
 
. 
 
r   r	   )dataclassesr   typingr   r   executorch.exir.scalar_typer   executorch.exir.tensorr   r   r	   r    r   r   <module>r.      s/    "   2 J
 
 
 
r   