+
    &j|/                     N   R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                   .t]P$                  ]P&                  ]P(                  ]P*                  .t]P.                  ]P0                  ]P2                  ]P4                  .t]P8                  ]P:                  ]P<                  .t]P@                  .]Ot!. ]O]Ot"R R lt#RRRRRRR	RR
RRR/R R llt$R# )z1
This module contains tensor creation utilities.
N)castc                p    V ^8  d   QhR\         P                  R\        R\        R\         P                  /# )   tlowhighreturn)torchTensorfloat)formats   "o/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/testing/_creation.py__annotate__r   $   s0     % % %5 % %%,, %    c                     W!,
          \         P                  ! V P                  4      P                  8  d0   V P	                  V^,          V^,          4      P                  ^4      # V P	                  W4      # )r   )r	   finfodtypemaxuniform_mul_)r   r   r   s   &&&r   _uniform_random_r   $   sT     zU[[)---zz#'4!8,11!44zz#$$r   r   r   requires_gradFnoncontiguousexclude_zeromemory_formatc                   V ^8  d   QhR\         \        P                  ,          \        \         ,          ,          \        \         R3,          ,          R\        P
                  R\        \        P                  ,          R\        R,          R\        R,          R\        R	\        R
\        R\        P                  R,          R\        P                  /
# )r   shape.r   devicer   Nr   r   r   r   r   r   )intr	   Sizelisttupler   strr   r   boolr   r
   )r   s   "r   r   r   -   s     g g%**tCy(5c?:g;;g %,,g 
	g
 $,g g g g &&-g \\gr   c                  a  R V 3R llp	\        V4      ^8X  d;   \        V^ ,          \        P                  P                  4      '       d
   V^ ,          p\        \        \        R3,          \        V4      4      pV'       d   Ve   \        RV: RV: 24      hV'       d   S \        9   d   \        RS : 24      hT;'       d    \        P                  ! R V^4      ^8  pV'       d4   \        \        \        R3,          . VRR O^VR,          ,          N54      pS \        P                  J dK   \        \        \        \        3,          V	! VV^ ^^ ^R	7      4      w  r#\        P                  ! W#WS R
7      p
EMS \        9   d   \        \        \        \        3,          T	! TT\        P                  ! S 4      P                   \        P                  ! S 4      P"                  S \        P$                  Jd   ^M^ ,           R^
R	7      4      w  r#\        P                  ! W#WS R
7      p
EMGS \&        9   d   V	! VV\        P(                  ! S 4      P                   \        P(                  ! S 4      P"                  R^	R	7      w  r#\        P*                  ! WS R
7      p
\-        S \.        9   d   \        P0                  ! V
4      MT
W#4       MS \2        9   d   V	! VV\        P(                  ! S 4      P                   \        P(                  ! S 4      P"                  R^	R	7      w  r#\        P*                  ! W\        P4                  R
7      p
\-        WV4       V
P7                  S 4      p
M\9        RS  R24      hV'       d   V
R,          p
MVe   V
P;                  VR7      p
V'       d3   S \        9   d   ^M\        P(                  ! S 4      P<                  W^ 8H  &   S \&        9   d   WJn        V
# )a  Creates a tensor with the given :attr:`shape`, :attr:`device`, and :attr:`dtype`, and filled with
values uniformly drawn from ``[low, high)``.

If :attr:`low` or :attr:`high` are specified and are outside the range of the :attr:`dtype`'s representable
finite values then they are clamped to the lowest or highest representable finite value, respectively.
If ``None``, then the following table describes the default values for :attr:`low` and :attr:`high`,
which depend on :attr:`dtype`.

+---------------------------+------------+----------+
| ``dtype``                 | ``low``    | ``high`` |
+===========================+============+==========+
| boolean type              | ``0``      | ``2``    |
+---------------------------+------------+----------+
| unsigned integral type    | ``0``      | ``10``   |
+---------------------------+------------+----------+
| signed integral types     | ``-9``     | ``10``   |
+---------------------------+------------+----------+
| floating types            | ``-9``     | ``9``    |
+---------------------------+------------+----------+
| complex types             | ``-9``     | ``9``    |
+---------------------------+------------+----------+

Args:
    shape (Tuple[int, ...]): Single integer or a sequence of integers defining the shape of the output tensor.
    dtype (:class:`torch.dtype`): The data type of the returned tensor.
    device (Union[str, torch.device]): The device of the returned tensor.
    low (Optional[Number]): Sets the lower limit (inclusive) of the given range. If a number is provided it is
        clamped to the least representable finite value of the given dtype. When ``None`` (default),
        this value is determined based on the :attr:`dtype` (see the table above). Default: ``None``.
    high (Optional[Number]): Sets the upper limit (exclusive) of the given range. If a number is provided it is
        clamped to the greatest representable finite value of the given dtype. When ``None`` (default) this value
        is determined based on the :attr:`dtype` (see the table above). Default: ``None``.

        .. deprecated:: 2.1

            Passing ``low==high`` to :func:`~torch.testing.make_tensor` for floating or complex types is deprecated
            since 2.1 and will be removed in 2.3. Use :func:`torch.full` instead.

    requires_grad (Optional[bool]): If autograd should record operations on the returned tensor. Default: ``False``.
    noncontiguous (Optional[bool]): If `True`, the returned tensor will be noncontiguous. This argument is
        ignored if the constructed tensor has fewer than two elements. Mutually exclusive with ``memory_format``.
    exclude_zero (Optional[bool]): If ``True`` then zeros are replaced with the dtype's small positive value
        depending on the :attr:`dtype`. For bool and integer types zero is replaced with one. For floating
        point types it is replaced with the dtype's smallest positive normal number (the "tiny" value of the
        :attr:`dtype`'s :func:`~torch.finfo` object), and for complex types it is replaced with a complex number
        whose real and imaginary parts are both the smallest positive normal number representable by the complex
        type. Default ``False``.
    memory_format (Optional[torch.memory_format]): The memory format of the returned tensor. Mutually exclusive
        with ``noncontiguous``.

Raises:
    ValueError: If ``requires_grad=True`` is passed for integral `dtype`
    ValueError: If ``low >= high``.
    ValueError: If either :attr:`low` or :attr:`high` is ``nan``.
    ValueError: If both :attr:`noncontiguous` and :attr:`memory_format` are passed.
    TypeError: If :attr:`dtype` isn't supported by this function.

Examples:
    >>> # xdoctest: +SKIP
    >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_CUDA)
    >>> from torch.testing import make_tensor
    >>> # Creates a float tensor with values in [-1, 1)
    >>> make_tensor((3,), device="cpu", dtype=torch.float32, low=-1, high=1)
    >>> # xdoctest: +SKIP
    tensor([ 0.1205, 0.2282, -0.6380])
    >>> # Creates a bool tensor on CUDA
    >>> make_tensor((2, 2), device="cuda", dtype=torch.bool)
    tensor([[False, False],
            [False, True]], device='cuda:0')
c                    V ^8  d   QhR\         R,          R\         R,          R\         R\         R\         R\         R\        \         \         3,          /# )	r   r   Nr   lowest_inclusivehighest_exclusivedefault_lowdefault_highr   )r   r!   )r   s   "r   r   !make_tensor.<locals>.__annotate__   s_     1 1T\1dl1  	1
 !1 1 1 
ue|	1r   c               @  < R R lpV e   T MTp Ve   TMTp\         ;QJ d    R W3 4       F  '       g   K   RM	  RM! R W3 4       4      '       d   \        RV : RV: 24      hW8X  d*   S\        9   d   \        P                  ! R\
        ^R	7       M>W8  d   \        R
V  RV 24      hW8  g   W8  d   \        RV  RV RS RV RV R24      hV! WV4      p V! WV4      pS\        9   d-   \        P                  ! V 4      \        P                  ! V4      3# W3# )z~
Modifies (and raises ValueError when appropriate) low and high values given by the user (input_low, input_high)
if required.
c                H    V ^8  d   QhR\         R\         R\         R\         /# )r   alhr   )r   )r   s   "r   r   :make_tensor.<locals>.modify_low_high.<locals>.__annotate__   s(     	% 	%U 	%u 	% 	%5 	%r   c                 ,    \        \        W4      V4      # N)minr   )r-   r.   r/   s   &&&r   clamp3make_tensor.<locals>.modify_low_high.<locals>.clamp   s    s1y!$$r   c              3   ~   "   T F3  p\        V\        4      ;'       d    \        P                  ! V4      x  K5  	  R # 5ir2   )
isinstancer   mathisnan).0values   & r   	<genexpr>7make_tensor.<locals>.modify_low_high.<locals>.<genexpr>   s+     W;%z%'==DJJu,==;s   ==TFz,`low` and `high` cannot be NaN, but got low=z
 and high=zPassing `low==high` to `torch.testing.make_tensor` for floating or complex types is deprecated since 2.1 and will be removed in 2.3. Use `torch.full(...)` instead.)
stacklevelz(`low` must be less than `high`, but got z >= z5The value interval specified by `low` and `high` is [z, z), but z only supports [))	any
ValueError_FLOATING_OR_COMPLEX_TYPESwarningswarnFutureWarning_BOOLEAN_OR_INTEGRAL_TYPESr8   ceil)r   r   r&   r'   r(   r)   r4   r   s   &&$$$$ r   modify_low_high$make_tensor.<locals>.modify_low_high   sA   	% _c+'t\3WC;W333WC;WWW?3&dWM  [U&@@MM1  [GuDQUPVWXX$(@GuBtf Ug-.>-?rBSATTUW 
 C+<=T->?.. 99S>499T?22yr   .NzaThe parameters `noncontiguous` and `memory_format` are mutually exclusive, but got noncontiguous=z and memory_format=zU`requires_grad=True` is not supported for boolean and integral dtypes, but got dtype=c                     W,          # r2    )xys   &&r   <lambda>make_tensor.<locals>.<lambda>   s    AEr   )r&   r'   r(   r)   )r   r   zThe requested dtype 'z' is not supported by torch.testing.make_tensor(). To request support, file an issue at: https://github.com/pytorch/pytorch/issues)r   i).:   Nr   ) lenr7   collectionsabcSequencer   r!   r   rA   rF   	functoolsreducer	   r#   randintiinfor3   r   int64rB   r   emptyr   _COMPLEX_TYPESview_as_real_FLOATING_8BIT_TYPESfloat32to	TypeErrorclonetinyr   )r   r   r   r   r   r   r   r   r   rH   results   d$$$$$$$*  r   make_tensorre   -   sK   d1 1f 5zQ:eAh0H0HIIasCx%,/E2&$&&:M+;=
 	

 "<<d^c]ef
 	
 "XXi&6&67I5RS&TWX&XM U38_&Bcr
&BAb	M&BC

#s(O!""#

	 s%eL	,	,#s(O!&U!3!7!7"'++e"4"8"8 U[[01a	#9 
	" s%eL	,	,#"[[/33#kk%044
	 U?*/>*AEv&vs	
 
&	&#"[[/33#kk%044
	 UGd+5!#E7 +_ _
 	

 	"		"M:44A%++e:L:Q:Q 	{ **,Mr   )%__doc__collections.abcrS   rV   r8   rC   typingr   r	   uint8int8int16int32rZ   uint16uint32uint64_INTEGRAL_TYPESfloat16bfloat16r_   float64_FLOATING_TYPESfloat8_e4m3fnfloat8_e5m2float8_e4m3fnuzfloat8_e5m2fnuzr^   	complex32	complex64
complex128r\   r#   rF   rB   r   re   rK   r   r   <module>r|      s<         
KK	JJ	KK	KK	KK	LL	LL	LL	 ==%..%--O					  //5??E4D4DE#jj;?; @@@ %g 	g
 g  g  g g 15g gr   