+
    &j+%                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIt. ROt]'       d   ^ RIH	t	 ^ RI
Ht R R ltR R	 ltR
 R ltR R ltR R ltR R ltR R ltRs] P(                  RR R ll4       tR R ltR# )    N	Generator)TYPE_CHECKING)
WorkerInfo)default_generatorc                <    V ^8  d   QhR\         P                  RR/# )   	new_statereturnNtorchTensor)formats   "d/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/random.py__annotate__r      s     	+ 	+U\\ 	+d 	+    c                2    \         P                  ! V 4       R# )zSets the random number generator state.

.. note:: This function only works for CPU. For CUDA, please use
    :func:`torch.manual_seed`, which works for both CPU and CUDA.

Args:
    new_state (torch.ByteTensor): The desired state
N)r   	set_state)r
   s   &r   set_rng_stater      s     	*r   c                8    V ^8  d   QhR\         P                  /# r	   r   r   )r   s   "r   r   r   '   s     ) )u|| )r   c                 ,    \         P                  ! 4       # )zReturns the random number generator state as a `torch.ByteTensor`.

.. note:: The returned state is for the default generator on CPU only.

See also: :func:`torch.random.fork_rng`.
)r   	get_state r   r   get_rng_stater   '   s     &&((r   c                L    V ^8  d   QhR\         P                  P                  /# r   r   _Cr   )r   s   "r   r   r   1   s     
# 
#++ 
#r   c                    \        V 4      # )a  Sets the seed for generating random numbers on all devices. Returns a
`torch.Generator` object.

Args:
    seed (int): The desired seed. Value must be within the inclusive range
        `[-0x8000_0000_0000_0000, 0xffff_ffff_ffff_ffff]`. Otherwise, a RuntimeError
        is raised. Negative inputs are remapped to positive values with the formula
        `0xffff_ffff_ffff_ffff + seed`.
)_manual_seed_impl)seeds   &r   manual_seedr"   1   s     T""r   c                L    V ^8  d   QhR\         P                  P                  /# r   r   )r   s   "r   r   r   >   s     / /uxx11 /r   c                 R   \        V 4      p ^ RIpVP                  P                  4       '       g   VP                  P	                  V 4       ^ RIpVP                  P                  4       '       g   VP                  P                  V 4       ^ RIpVP                  P                  4       '       g   VP                  P	                  V 4       ^ RI
pVP                  P                  4       '       g   VP                  P	                  V 4       \        V 4       \        P                  ! V 4      # )r   N)int
torch.cudacuda_is_in_bad_forkmanual_seed_all	torch.mpsmpsr"   	torch.xpuxpu
torch.mtiamtia_seed_custom_devicer   r!   r   s   & r   r    r    >   s    t9D::%%''

""4(99$$&&		d#99$$&&		!!$'::%%''

""4(((..r   c                $    V ^8  d   QhR\         /# r   r%   )r   s   "r   r   r   Y   s      c r   c                 >   \         P                  ! 4       p ^ RIpVP                  P	                  4       '       g   VP                  P                  V 4       ^ RIpVP                  P	                  4       '       g   VP                  P                  V 4       ^ RI	pVP                  P	                  4       '       g   VP                  P                  V 4       ^ RIpVP                  P	                  4       '       g   VP                  P                  V 4       \        V 4       V # )zSets the seed for generating random numbers to a non-deterministic
random number on all devices. Returns a 64 bit number used to seed the RNG.
N)r   r!   r&   r'   r(   r)   r*   r+   r"   r,   r-   r.   r/   r0   r1   s     r   r!   r!   Y   s     !!#D::%%''

""4(99$$&&		d#99$$&&		!!$'::%%''

""4(Kr   c                    V ^8  d   QhRR/# r	   r   Nr   )r   s   "r   r   r   w   s     > > >r   c                   \        V 4      p \        P                  P                  4       p\	        \        V4      '       d   \        \        V4      pRpRp\	        W#4      '       d=   \	        W$4      '       d,   \        W#4      ! 4       '       g   \        W$4      ! V 4       R
# R
# RV R2pVRV RV RV R2,          p\        P                  ! V\        ^R	7       R
# R
# )zSets the seed to generate random numbers for custom device.

Args:
    seed (int): The desired seed.

See [Note: support the custom device with privateuse1]
r(   r)   zSet seed for `z0` device does not take effect, please add API's `z` and `z` to `z` device module.
stacklevelN)	r%   r   r   _get_privateuse1_backend_namehasattrgetattrwarningswarnUserWarning)r!   custom_backend_namecustom_device_mod_bad_fork_name_seed_all_namemessages   &     r   r0   r0   w   s     t9D((@@Bu)**#E+>?**$55';
 ;
 ,=??):4@ @ '':&;;klG>*'.1AH[G\\lmmGMM';1= +r   c                $    V ^8  d   QhR\         /# r   r3   )r   s   "r   r   r      s     , ,c ,r   c                 ,    \         P                  ! 4       # )zReturns the initial seed for generating random numbers as a
Python `long`.

.. note:: The returned seed is for the default generator on CPU only.
)r   initial_seedr   r   r   rH   rH      s     ))++r   Fc                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r      s     M? M? M?r   c              #    "   VR8X  d   Rx  R# \         P                  ! V4      P                  p\        \         VR4      pVf   \	        RV R2R,           4      hV'       g   Rx  R# V f   VP                  4       pV^8  d   \        '       g   VP                  4        RV RV RVP                  4        R	VP                  4        R
VP                  4        RVP                  4        RV RV RVP                  4        RV RV R2p\        P                  ! V^R7       Rs\        \        V4      4      p M\        V 4      p \         P                  ! 4       pV  U	u. uF  qP                  V	4      NK  	  p
p	 Rx  \         P                  ! V4       \        W
4       F  w  rVP                  W4       K  	  R# u up	i   \         P                  ! T4       \        Y
4       F  w  rTP                  Y4       K  	  i ; i5i)aB  
Forks the RNG, so that when you return, the RNG is reset
to the state that it was previously in.

Args:
    devices (iterable of Device IDs): devices for which to fork
        the RNG. CPU RNG state is always forked. By default, :meth:`fork_rng` operates
        on all devices, but will emit a warning if your machine has a lot
        of devices, since this function will run very slowly in that case.
        If you explicitly specify devices, this warning will be suppressed
    enabled (bool): if ``False``, the RNG is not forked.  This is a convenience
        argument for easily disabling the context manager without having
        to delete it and unindent your Python code under it.
    device_type (str): device type str, default is `cuda`. As for supported device,
        see details in :ref:`accelerator<accelerators>`
metaNztorch has no module of `z`, you should register z,a module by `torch._register_device_module`.z reports that you have z& available devices, and you have used z_ without explicitly specifying which devices are being used. For safety, we initialize *every* zA device by default, which can be quite slow if you have a lot of z5s. If you know that you are only making use of a few z' devices, set the environment variable z_VISIBLE_DEVICES or the 'z' keyword argument of z with the set of devices you are actually using. For example, if you are using CPU only, set device.upper()_VISIBLE_DEVICES= or devices=[]; if you are using device 0 only, set zb_VISIBLE_DEVICES=0 or devices=[0].  To initialize all devices and suppress this warning, set the 'z#' keyword argument to `range(torch.z.device_count())`.r9   T)r   devicetyper=   RuntimeErrordevice_count_fork_rng_warned_alreadyupperr>   r?   listranger   r   zip)devicesenabled_caller_devices_kwdevice_type
device_modnum_devicesrE   cpu_rng_staterL   device_rng_statesdevice_rng_states   &&&&&       r   fork_rngr_      s    2 f,,{+00KT2J&{m3JK<=
 	
  --/?#;#;$$&''>{m L!!(	 *55@5F5F5H4I J66A6G6G6I5J K((3(9(9(;'<<c$$&''@Mcdkcl m #((*+ ,77Bm D  +},>
@  MM'a0'+$u[)* w-'')MHOPf11&9P?M*(+G(G$F$$%5> )H Q
 	M*(+G(G$F$$%5> )Hs8   A G?#,G?CG?F:6G?9F? =AG??=G<<G?c                F    V ^8  d   QhR\         P                  R,          /# r6   )r   r   )r   s   "r   r   r      s     ! !u5 !r   c                     ^ RI Hp  V ! 4       pVe6   VP                  R8X  d%   VP                  e   VP                  P                  # R# )a'  Returns a thread-safe random number generator for use in DataLoader workers.
This function provides a convenient way for transforms and user code to use
thread-safe random number generation without manually checking worker context.
When called in a DataLoader thread worker, returns the worker's thread-local
:class:`torch.Generator`. When called in the main process or process workers,
returns ``None`` (which causes PyTorch functions to use the default global RNG).
Returns:
    Optional[torch.Generator]: Thread-local generator in thread workers, None otherwise.
Example::
    >>> from torch.random import thread_safe_generator
    >>> generator = thread_safe_generator()
    >>> torch.randint(0, 10, (5,), generator=generator)
Example with transforms::
    >>> from torch.random import thread_safe_generator
    >>> class MyRandomTransform:
    ...     def __call__(self, img):
    ...         generator = thread_safe_generator()
    ...         offset = torch.randint(0, 10, (2,), generator=generator)
    ...         return img[..., offset[0]:, offset[1]:]
)get_worker_infoNthread)torch.utils.datarb   worker_methodrngtorch_generator)rb   worker_infos     r   thread_safe_generatorri      s@    0 1%4%6K%%1OO'...r   )r   r   r"   r!   rH   r_   ri   )NTr_   rU   r'   )
contextlibr>   collections.abcr   typingr   r   __all__torch.utils.data._utils.workerr   torch._Cr   r   r   r"   r    r!   r0   rH   rP   contextmanagerr_   ri   r   r   r   <module>rq      ss      %    9 &	+)
#/6<>2, !  M? M?`!r   