
    gh                        d Z ddlZddlZddlZddlZddlZddlZd Zd Z	d Z
d Zd Zd Zej        dd	            Z	 ddZd Zej        d         Z ee          D ]<Z eee          Z ej        e          reZ eeej                  r ee           =ej        dfdZ eededd           ddej        dd
fdZ eededd           dej        dfdZ eededd           dS )a  

This is a set of function wrappers that override the default numpy versions.

Interoperability functions for pytorch and Faiss: Importing this will allow
pytorch Tensors (CPU or GPU) to be used as arguments to Faiss indexes and
other functions. Torch GPU tensors can only be used with Faiss GPU indexes.
If this is imported with a package that supports Faiss GPU, the necessary
stream synchronization with the current pytorch stream will be automatically
performed.

Numpy ndarrays can continue to be used in the Faiss python interface after
importing this file. All arguments must be uniformly either numpy ndarrays
or Torch tensors; no mixing is allowed.

    Nc                     |                                  sJ | j        t          j        k    sJ t	          j        |                                                                 |                                 z             S )A gets a Faiss SWIG pointer from a pytorch tensor (on CPU or GPU) )	is_contiguousdtypetorchuint8faisscast_integer_to_uint8_ptruntyped_storagedata_ptrstorage_offsetxs    W/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/faiss/contrib/torch_utils.pyswig_ptr_from_UInt8Tensorr   #   sn    ??7ek!!!!*	$$&&)9)9););;= = =    c                     |                                  sJ | j        t          j        k    sJ t	          j        |                                                                 |                                 dz  z             S r      )	r   r   r   float16r	   cast_integer_to_void_ptrr   r   r   r   s    r   swig_ptr_from_HalfTensorr   +   sv    ??7em####)	$$&&)9)9););a)??A A Ar   c                     |                                  sJ | j        t          j        k    sJ t	          j        |                                                                 |                                 dz  z             S )r      )	r   r   r   float32r	   cast_integer_to_float_ptrr   r   r   r   s    r   swig_ptr_from_FloatTensorr   4   sv    ??7em####*	$$&&)9)9););a)??A A Ar   c                     |                                  sJ | j        t          j        k    sJ t	          j        |                                                                 |                                 dz  z             S r   )	r   r   r   bfloat16r	   r   r   r   r   r   s    r   swig_ptr_from_BFloat16Tensorr    ;   sv    ??7en$$$$)	$$&&)9)9););a)??A A Ar   c                    |                                  sJ | j        t          j        k    sJ d| j        z              t	          j        |                                                                 |                                 dz  z             S )r   dtype=%sr   )	r   r   r   int32r	   cast_integer_to_int_ptrr   r   r   r   s    r   swig_ptr_from_IntTensorr%   C   s    ??7ek!!!:#7!!!(	$$&&)9)9););a)??A A Ar   c                    |                                  sJ | j        t          j        k    sJ d| j        z              t	          j        |                                                                 |                                 dz  z             S )r   r"      )	r   r   r   int64r	   cast_integer_to_idx_t_ptrr   r   r   r   s    r   swig_ptr_from_IndicesTensorr*   K   s    ??7ek!!!:#7!!!*	$$&&)9)9););a)??A A Ar   c              #     K   |t           j                                        }t          j        |j                  }t           j                                        }|                     t           j                                                  }|                     t           j                                        |           	 dV  |                     ||           dS # |                     ||           w xY w)z Creates a scoping object to make Faiss GPU use the same stream
        as pytorch, based on torch.cuda.current_stream().
        Or, a specific pytorch stream can be passed in as a second
        argument, in which case we will use that stream.
    N)	r   cudacurrent_streamr	   cast_integer_to_cudastream_tcuda_streamcurrent_devicegetDefaultStreamsetDefaultStream)respytorch_streamcuda_stream_s	prior_devprior_streams        r   using_streamr8   V   s       2244 6~7QRRM 
))++I''
(A(A(C(CDDL2244mDDD6Y55555Y5555s   >C C2Fc                     	 t          | |          }n# t          $ r |rY d S  w xY w|j        d|z   k    rd S |s|j        d|z   k    sJ t          | |dz   |           t          | ||           d S )Ntorch_replacement_replacement__numpy)getattrAttributeError__name__setattr)	the_classnamereplacementignore_missingignore_no_baseorig_methods         r   torch_replace_methodrG   p   s    i..    	FF 3d::: Lk2nt6KKKKKIth444It[)))))s    $$c                 l   d }d }d#d}d }d d$fd	}d%fd	}d d dfd	
}d
 }d#d}	d&d}
d }d }d#d}d#d}t          | d|           t          | d|           t          | d|           t          | d|           t          | d|           t          | d|           t          | d|	           t          | d|
           t          | d|           t          | d|d           t          | d|d           t          | d |d           t          | d!|           t          | d"|           d S )'Nc                    t          |          t          j        u r|                     |          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }|j	        rlt          | d          s
J d            t          |                                           5  |                     ||           d d d            d S # 1 swxY w Y   d S |                     ||           d S N	getDevice#GPU tensor on CPU index not allowed)typenpndarray	add_numpyr   Tensorshapedr   is_cudahasattrr8   getResourcesadd_cselfr   nrS   x_ptrs        r   torch_replacement_addz1handle_torch_Index.<locals>.torch_replacement_add   s@   77bj  >>!$$$Aww%,&&&&w1DF{{{{)!,,9 	!4--TT/TTTT d//1122 % %

1e$$$% % % % % % % % % % % % % % % % % % JJq%        6CC!Cc                    t          |          t          j        u r|                     ||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }t          |          t          j        u sJ |j        |fk    s
J d            t          |          }|j
        rmt          | d          s
J d            t          |                                           5  |                     |||           d d d            d S # 1 swxY w Y   d S |                     |||           d S )Nz!not same number of vectors as idsrK   rL   )rM   rN   rO   add_with_ids_numpyr   rQ   rR   rS   r   r*   rT   rU   r8   rV   add_with_ids_c)rY   r   idsrZ   rS   r[   ids_ptrs          r   torch_replacement_add_with_idsz:handle_torch_Index.<locals>.torch_replacement_add_with_ids   s   77bj  **1c222Aww%,&&&&w1DF{{{{)!,,CyyEL((((yQE!!!#F!!!-c229 	34--TT/TTTT d//1122 7 7##Aug6667 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 5'22222s   9DD"%D"c                    t          |          t          j        u r|                     |||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }|(t	          j	        |||j
        t          j                  }n,t          |          t          j        u sJ |j        ||fk    sJ t          |          }|j        rlt          | d          s
J d            t          |                                           5  |                     ||||           d d d            n# 1 swxY w Y   n|                     ||||           |S )Ndevicer   rK   rL   )rM   rN   rO   assign_numpyr   rQ   rR   rS   r   emptyrf   r(   r*   rT   rU   r8   rV   assign_c)rY   r   klabelsrZ   rS   r[   L_ptrs           r   torch_replacement_assignz4handle_torch_Index.<locals>.torch_replacement_assign   s   77bj  $$Q6222Aww%,&&&&w1DF{{{{)!,,>[AahekJJJFF<<5<////<Aq6))))+F339 	.4--TT/TTTT d//1122 2 2aq1112 2 2 2 2 2 2 2 2 2 2 2 2 2 2 MM!UE1---s   EE	Ec                    t          |          t          j        u r|                     |          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }|j	        rlt          | d          s
J d            t          |                                           5  |                     ||           d d d            d S # 1 swxY w Y   d S |                     ||           d S rJ   )rM   rN   rO   train_numpyr   rQ   rR   rS   r   rT   rU   r8   rV   train_crX   s        r   torch_replacement_trainz3handle_torch_Index.<locals>.torch_replacement_train   sB   77bj  ##A&&&Aww%,&&&&w1DF{{{{)!,,9 	#4--TT/TTTT d//1122 ' 'Q&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' LLE"""""r]   c                    | j         \  }}t          |           }|(t          j        ||| j        t          j                  }n,t          |          t          j        u sJ |j         ||fk    sJ t          |          }|(t          j        ||| j        t          j                  }n,t          |          t          j        u sJ |j         ||fk    sJ t          |          }|||||fS )Nre   )
rR   r   r   rh   rf   r   rM   rQ   r(   r*   )	r   rj   DIrZ   rS   r[   D_ptrI_ptrs	            r   search_methods_commonz1handle_torch_Index.<locals>.search_methods_common   s    w1)!,,9AqGGGAA77el****7q!f$$$$)!,,9AqEEEAA77el****7q!f$$$$+A..eUAq((r   c                    t          |          t          j        u r|                     ||||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ  
||||          \  }}}	}}|j        rmt          | d          s
J d            t          |                                           5  |                     |||||	           d d d            n# 1 swxY w Y   n|                     |||||	           ||fS )Nrs   rt   rK   rL   )rM   rN   rO   search_numpyr   rQ   rR   rS   rT   rU   r8   rV   search_c)rY   r   rj   rs   rt   rZ   rS   r[   ru   rv   rw   s             r   torch_replacement_searchz4handle_torch_Index.<locals>.torch_replacement_search   sa   77bj  $$QQ!$444Aww%,&&&&w1DF{{{{$9$9!Q1$E$E!ueQ9 	54--TT/TTTT d//1122 9 9a5%8889 9 9 9 9 9 9 9 9 9 9 9 9 9 9 MM!UAue444!ts    C&&C*-C*c           	         t          |          t          j        u r|                     |||||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ  ||||          \  }}	}
}}|)t	          j        ||||j	        t          j
                  }n-t          |          t          j        u sJ |j        |||fk    sJ t          |          }|j        rnt          | d          s
J d            t          |                                           5  |                     ||||	|
|           d d d            n# 1 swxY w Y   n|                     ||||	|
|           |||fS )N)rs   rt   Rre   rK   rL   )rM   rN   rO   search_and_reconstruct_numpyr   rQ   rR   rS   rh   rf   r   r   rT   rU   r8   rV   search_and_reconstruct_c)rY   r   rj   rs   rt   r~   rZ   rS   r[   ru   rv   R_ptrrw   s               r   (torch_replacement_search_and_reconstructzDhandle_torch_Index.<locals>.torch_replacement_search_and_reconstruct  s   77bj  44QQ!q4IIIAww%,&&&&w1DF{{{{$9$9!Q1$E$E!ueQ9Aq!AHEMJJJAA77el****7q!Qi'''')!,,9 	L4--TT/TTTT d//1122 P P--a5%OOOP P P P P P P P P P P P P P P ))!UAueUKKK!Qws   (EEEry   c                   t          |          t          j        u r|                     ||||||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ  ||||          \  }	}
}}}|j        || j        fk    sJ |	                                }t          |          }|6|	                                }|j        |j        k    sJ t          |          }nd }|j        rpt          | d          s
J d            t          |                                           5  |                     ||	||||
|d           d d d            n# 1 swxY w Y   n|                     ||	||||
|d           ||fS )Nry   rK   rL   F)rM   rN   rO   search_preassigned_numpyr   rQ   rR   rS   nprobe
contiguousr*   r   rT   rU   r8   rV   search_preassigned_c)rY   r   rj   IqDqrs   rt   rZ   rS   r[   ru   rv   Iq_ptrDq_ptrrw   s                 r   $torch_replacement_search_preassignedz@handle_torch_Index.<locals>.torch_replacement_search_preassigned,  s   77bj  00Ar2a0HHHAww%,&&&&w1DF{{{{$9$9!Q1$E$E!ueQxAt{+++++]]__,R00>B8rx''''.r22FFF9 	X4--TT/TTTT d//1122 \ \))!UAvvueUZ[[[\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %%a665%QVWWW!ts   3EE #E c                 v    t          |          t          j        us
J d            |                     |          S )Nz(remove_ids not yet implemented for torch)rM   r   rQ   remove_ids_numpy)rY   r   s     r   torch_replacement_remove_idsz8handle_torch_Index.<locals>.torch_replacement_remove_idsN  s8    Awwel***,V***$$Q'''r   c                    |1t          |          t          j        u r|                     ||          S t	          j        d          }t          | d          r't	          j        d|                                           }|'t	          j        | j	        |t          j
                  }n0t          |          t          j        u sJ |j        | j	        fk    sJ t          |          }|j        rjt          | d          s
J d            t          |                                           5  |                     ||           d d d            n# 1 swxY w Y   n|                     ||           |S )NcpurK   r,   re   rL   )rM   rN   rO   reconstruct_numpyr   rf   rU   rK   rh   rS   r   rQ   rR   r   rT   r8   rV   reconstruct_c)rY   keyr   rf   r[   s        r   torch_replacement_reconstructz9handle_torch_Index.<locals>.torch_replacement_reconstructS  s    MQ2: 5 5))#q111 e$$4%% 	<\&$..*:*:;;F9DF6GGGAA77el****7tvj(((()!,,9 	+4--TT/TTTT d//1122 / /""3.../ / / / / / / / / / / / / / / sE***s   )EEEr   c                    |dk    r| j         }|2t          |          t          j        u r|                     |||          S t          j        d          }t          | d          r't          j        d|                                           }|(t          j	        || j
        |t
          j                  }n1t          |          t
          j        u sJ |j        || j
        fk    sJ t          |          }|j        rkt          | d          s
J d            t!          |                                           5  |                     |||           d d d            n# 1 swxY w Y   n|                     |||           |S )Nr   r   rK   r,   re   rL   )ntotalrM   rN   rO   reconstruct_n_numpyr   rf   rU   rK   rh   rS   r   rQ   rR   r   rT   r8   rV   reconstruct_n_c)rY   n0nir   rf   r[   s         r   torch_replacement_reconstruct_nz;handle_torch_Index.<locals>.torch_replacement_reconstruct_nu  s   88B
 MQ2: 5 5++BA666 e$$4%% 	<\&$..*:*:;;F9BvU]KKKAA77el****7r46l****)!,,9 	04--TT/TTTT d//1122 4 4$$RU3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4   R///s   9EE!$E!c                 h   t          |          t          j        u r|                     ||          S t          |          t          j        u sJ |j        \  }t          |          }t          |          t          j        u sJ |j        || j        fk    sJ t          |          }|j
        rmt          | d          s
J d            t          |                                           5  |                     |||           d d d            d S # 1 swxY w Y   d S |                     |||           d S rJ   )rM   rN   rO   update_vectors_numpyr   rQ   rR   r*   rS   r   rT   rU   r8   rV   update_vectors_c)rY   keysr   rZ   keys_ptrr[   s         r    torch_replacement_update_vectorsz<handle_torch_Index.<locals>.torch_replacement_update_vectors  sz   ::##,,T1555DzzU\))))
.t44Aww%,&&&&w1df+%%%%)!,,9 	64--TT/TTTT d//1122 : :%%a5999: : : : : : : : : : : : : : : : : : !!!Xu55555s   )DDDc                 l   t          |          t          j        u r|                     ||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }|j	        r
J d            t          | d          r
J d            t          j        |          }|                     ||||           t	          j        t          j        |j        |dz                                                                 d                    }t'          |d                   }t	          j        t          j        |j        |                                                    }	t	          j        t          j        |j        |                                                    }
||	|
fS )Nz1Range search using GPU tensor not yet implementedrK   z-Range search on GPU index not yet implemented   r(   r   )rM   rN   rO   range_search_numpyr   rQ   rR   rS   r   rT   rU   r	   RangeSearchResultrange_search_c
from_numpyrev_swig_ptrlimscopyastypeint	distancesrk   )rY   r   threshrZ   rS   r[   r3   r   ndrs   rt   s              r   torch_replacement_range_searchz:handle_torch_Index.<locals>.torch_replacement_range_search  s|   77bj  **1f555Aww%,&&&&w1DF{{{{)!,,9QQQQQQ4--^^/^^^^%a((Aufc222  238QU C C H H J J Q QRY Z Z[[b]]U/rBBGGIIJJU/
B??DDFFGGQzr   c                    t          |          t          j        u r|                     ||          S t          |          t          j        u sJ |j        \  }}|| j        k    sJ t          |          }|4t	          j	        || 
                                t          j                  }n!|j        || 
                                fk    sJ t          |          }|j        rkt          | d          s
J d            t          |                                           5  |                     |||           d d d            n# 1 swxY w Y   n|                     |||           |S N)r   rK   rL   )rM   rN   rO   sa_encode_numpyr   rQ   rR   rS   r   rh   sa_code_sizer   r   rT   rU   r8   rV   sa_encode_c)rY   r   codesrZ   rS   r[   	codes_ptrs          r   torch_replacement_sa_encodez7handle_torch_Index.<locals>.torch_replacement_sa_encode  s   77bj  ''5111Aww%,&&&&w1DF{{{{)!,,=K4#4#4#6#6ekJJJEE;1d&7&7&9&9":::::-e44	9 	24--TT/TTTT d//1122 6 6  E95556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Qy111s   EEEc                    t          |          t          j        u r|                     ||          S t          |          t          j        u sJ |j        \  }}||                                 k    sJ t          |          }|'t	          j	        || j
        t          j                  }n1t          |          t          j        u sJ |j        || j
        fk    sJ t          |          }|j        rkt          | d          s
J d            t          |                                           5  |                     |||           d d d            n# 1 swxY w Y   n|                     |||           |S r   )rM   rN   rO   sa_decode_numpyr   rQ   rR   r   r   rh   rS   r   r   rT   rU   r8   rV   sa_decode_c)rY   r   r   rZ   csr   r[   s          r   torch_replacement_sa_decodez7handle_torch_Index.<locals>.torch_replacement_sa_decode  s   ;;"*$$''q111E{{el****2T&&((((((-e44	9AtvU];;;AA77el****7q$&k)))))!,,= 	24--TT/TTTT d//1122 6 6  Iu5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Q	5111s   -EEEaddadd_with_idsassigntrainsearch
remove_idsreconstructreconstruct_nrange_searchupdate_vectorsT)rD   search_and_reconstructsearch_preassigned	sa_encode	sa_decodeN)NN)NNN)r   r   N)rG   )rA   r\   rc   rm   rq   r|   r   r   r   r   r   r   r   r   r   rw   s                  @r   handle_torch_Indexr      s   ! ! !(3 3 30   :# # #() ) )(     .     < GKd              D( ( (
       D# # # #J6 6 62  6   8   < E+@AAAN4RSSSH.FGGGG-DEEEH.FGGGL2NOOOM3PQQQO5TUUUN4RSSS$46V(,. . . .$<ARVX X X X$8<TS S S SK1LMMMK1LMMMMMr   r	   c                    t          |          t          j        u rt          j        | ||||          S |                                \  }}|                                sJ |j        t          j	        k    sJ |j
        r
J d            |                                 \  }}||k    sJ |                                 sJ | j        t          j	        k    sJ | j
        r
J d            t          j        |||j        t          j	                  }	t          j        |||j        t          j                  }
t          |
          }t          |	          }t          |          }t          |           }|t          j        k    rt          j        ||||||||           nI|t          j        k    rt          j        ||||||||           nt          j        ||||||||||
  
         |	|
fS )N)metric
metric_argzuse knn_gpu for GPU tensorsre   )rM   rN   rO   r	   	knn_numpysizer   r   r   r   rT   rh   rf   r(   r*   r   	METRIC_L2	knn_L2sqrMETRIC_INNER_PRODUCTknn_inner_productknn_extra_metrics)xqxbrj   r   r   nbrS   nqd2rs   rt   rv   ru   xb_ptrxq_ptrs                  r   torch_replacement_knnr   &  s   Bxx2:r2qJOOOOGGIIEB8u}$$$$z888888WWYYFB77778u}$$$$z888888B")5=AAAAB")5;???A'**E%a((E&r**F&r**F  Fr2q%	
 	
 	
 	
 
5-	-	-Fr2q%	
 	
 	
 	

 	Fr2vz1eU	
 	
 	

 a4Kr   knnTr   c	           
         t          |          t          j        u rt          j        | |||||||          S |                                \  }	}
|                                rd}nL|                                                                r|                                }d}nt          d          |j	        t          j        k    rt          j        }t          |          }nq|j	        t          j        k    rt          j        }t!          |          }n@|j	        t          j        k    rt          j        }t'          |          }nt          d          |                                \  }}||
k    sJ |                                rd}nL|                                                                r|                                }d}nt          d          |j	        t          j        k    rt          j        }t          |          }nq|j	        t          j        k    rt          j        }t!          |          }n@|j	        t          j        k    rt          j        }t'          |          }nt          d          |(t          j        |||j        t          j                  }n&|j        ||fk    sJ |j	        t          j        k    sJ |(t          j        |||j        t          j                  }n|j        ||fk    sJ |j	        t          j        k    rt          j        }t3          |          }nO|j	        |j	        cxk    rt          j        k    rn nt          j        }t9          |          }nt          d          t          |          }t          j                    }||_        ||_        |
|_         ||_!        ||_"        ||_#        |	|_$        ||_%        ||_&        ||_'        ||_(        ||_)        ||_*        ||_+        ||_        ||_,        t[          |           5  t          j.        | |           d d d            n# 1 swxY w Y   ||fS )NTFz$matrix should be row or column-majorz'xq must be float32, float16 or bfloat16re   zI must be i64 or i32)/rM   rN   rO   r	   knn_gpu_numpyr   r   t	TypeErrorr   r   r   DistanceDataType_F32r   r   DistanceDataType_F16r   r   DistanceDataType_BF16r    rh   rf   rR   r(   IndicesDataType_I64r*   r#   IndicesDataType_I32r%   GpuDistanceParamsr   rj   dimsvectorsvectorsRowMajor
vectorType
numVectorsqueriesqueriesRowMajor	queryType
numQueriesoutDistances
outIndicesoutIndicesTypeuse_cuvsr8   bfKnn)r3   r   r   rj   rs   rt   r   rf   r   r   rS   xb_row_majorxb_typer   r   r   xq_row_majorxq_typer   I_typerv   ru   argss                          r   torch_replacement_knn_gpur  T  s)   Bxx2:"3B1aHHHGGIIEB	 @					 @TTVV>???	x5=  ,*2..	U]	"	",)"--	U^	#	#--b11ABBBWWYYFB7777	 @					 @TTVV>???	x5=  ,*2..	U]	"	",)"--	U^	#	#--b11ABBByKAbiu}EEEw2q'!!!!5=((((yKAbiu{CCCw2q'!!!!w%+*+A..	
AG	*	*	*	*u{	*	*	*	*	**'**.///%a((E"$$DDKDFDIDL'DDODODL'DDNDODDO DDKDM	c		  C               a4Ks   !QQ
Qknn_gpuc                 :   t          |          t          j        u rt          j        | ||||          S |                                \  }}|                                rd}nL|                                                                r|                                }d}nt          d          |j	        t          j        k    rt          j        }	t          |          }
n@|j	        t          j        k    rt          j        }	t!          |          }
nt          d          |                                \  }}||k    sJ |                                rd}nL|                                                                r|                                }d}nt          d          |j	        t          j        k    rt          j        }t          |          }n@|j	        t          j        k    rt          j        }t!          |          }nt          d          |(t          j        |||j        t          j                  }n&|j        ||fk    sJ |j	        t          j        k    sJ t          |          }t          j                    }||_        d|_        ||_        |
|_        ||_        |	|_        ||_        ||_        ||_        ||_        ||_        ||_         ||_        tC          |           5  t          j"        | |           d d d            n# 1 swxY w Y   |S )	NTFz'xb matrix should be row or column-majorzxb must be float32 or float16z'xq matrix should be row or column-majorzxq must be float32 or float16re   r   )#rM   rN   rO   r	   pairwise_distance_gpu_numpyr   r   r   r   r   r   r   r   r   r   r   r   rh   rf   rR   r   r   rj   r   r   r   r   r   r   r   r   r   r   r8   r   )r3   r   r   rs   r   rf   r   rS   r   r   r   r   r   r   r   r   ru   r   s                     r   'torch_replacement_pairwise_distance_gpur    s   Bxx2:0b"aHHHGGIIEB	 C					 CTTVVABBB	x5=  ,*2..	U]	"	",)"--7888WWYYFB7777	 C					 CTTVVABBB	x5=  ,*2..	U]	"	",)"--7888yKBryFFFw2r(""""5=((((%a((E"$$DDKDFDIDL'DDODODL'DDNDODDK	c		  C               Hs   .LLLpairwise_distance_gpur   )FF) __doc__r	   r   
contextlibinspectsysnumpyrN   r   r   r   r    r%   r*   contextmanagerr8   rG   r   modulesfaiss_moduledirsymbolr=   objisclassrA   
issubclassIndexr   r   r  r   r   r   <module>r     sP   $        



    = = =A A AA A AA A AA A AA A A 6 6 6 64 ?D* * * **SN SN SNj {7# c, * *F
',
'
'Cws *	:i-- 	*y))) -2O ' ' ' 'T  \5*?t L L L 15U_]_jo \ \ \ \|  \9.Gt T T T <@`b E E E EN  \#:<ceiko p p p p pr   