
     ic                         d dl Z d dlZ G d de      Z G d de      Zdej                  fdZdej                  fdZdej                  fd	Z	y)
    Nc                       e Zd Zy)ReproducibilityErrorN__name__
__module____qualname__     y/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/pyannote/audio/utils/reproducibility.pyr   r          r
   r   c                       e Zd Zy)ReproducibilityWarningNr   r	   r
   r   r   r   "   r   r
   r   devicec                     | j                   dk(  r^t        j                  j                  j                  j
                  s$t        j                  j                  j
                  rt        d      y y Ncudaa8  Please disable TensorFloat-32 (TF32) by calling
   >>> import torch
   >>> torch.backends.cuda.matmul.allow_tf32 = False
   >>> torch.backends.cudnn.allow_tf32 = False
or you might face reproducibility issues and obtain lower accuracy.
See https://github.com/pyannote/pyannote-audio/issues/1370 for more details.)typetorchbackendsr   matmul
allow_tf32cudnnr   r   s    r   raise_reproducibilityr   &   sW    v""--1E1E1P1P"[
 	
 2Q 	r
   c                    | j                   dk(  rrt        j                  j                  j                  j
                  s$t        j                  j                  j
                  rt        j                  t        d             y y y r   
r   r   r   r   r   r   r   warningswarnr   r   s    r   warn_reproducibilityr   4   s^    v""--1E1E1P1P"_		
 2Q 	r
   c                    | j                   dk(  rt        j                  j                  j                  j
                  s$t        j                  j                  j
                  rgdt        j                  j                  j                  _        dt        j                  j                  _        t        j                  t        d             y y y )Nr   FaJ  TensorFloat-32 (TF32) has been disabled as it might lead to reproducibility issues and lower accuracy.
It can be re-enabled by calling
   >>> import torch
   >>> torch.backends.cuda.matmul.allow_tf32 = True
   >>> torch.backends.cudnn.allow_tf32 = True
See https://github.com/pyannote/pyannote-audio/issues/1370 for more details.
r   r   s    r   fix_reproducibilityr!   D   s    v""--1E1E1P1P05""-*/'"a		
	 2Q 	r
   )
r   r   	Exceptionr   UserWarningr   r   r   r   r!   r	   r
   r   <module>r$      sU   2  9 [ 
%,, 

 
 
 
r
   