# encoding: utf-8
# module simsimd calls itself SimSIMD
# from C:\Programs\Python\Python313\Lib\site-packages\simsimd.cp313-win_amd64.pyd
# by generator 1.147
"""
Portable mixed-precision BLAS-like vector math library for x86 and ARM.

Performance Recommendations:
 - Avoid converting to NumPy arrays. SimSIMD works with any Tensor implementation
   compatible with Python's Buffer Protocol, which can be coming from PyTorch, TensorFlow, etc.
 - In low-latency environments - provide the output array with the `out=` parameter
   to avoid expensive memory allocations on the hot path.
 - On modern CPUs, if the application allows, prefer low-precision numeric types.
   Whenever possible, use 'bf16' and 'f16' over 'f32'. Consider quantizing to 'i8'
   and 'u8' for highest hardware compatibility and performance.
 - If you are only interested in relative proximity instead of the absolute distance
   prefer simpler kernels, like the Squared Euclidean distance over the Euclidean distance.
 - Use row-major continuous matrix representations. Strides between rows won't have significant
   impact on performance, but most modern HPC packages explicitly ban non-contiguous rows,
   where the nearby matrix cells within a row have multi-byte gaps.
 - The CPython runtime has a noticeable overhead for function calls, so consider batching
   kernel invokations. Many kernels can compute not only 1-to-1 distance between vectors,
   but also 1-to-N and N-to-N distances between two batches of vectors packed into matrices.

Example:
    >>> import simsimd
    >>> simsimd.l2(a, b)

Mixed-precision 1-to-N example with numeric types missing in NumPy, but present in PyTorch:
    >>> import simsimd
    >>> import torch
    >>> a = torch.randn(1536, dtype=torch.bfloat16)
    >>> b = torch.randn((100, 1536), dtype=torch.bfloat16)
    >>> c = torch.zeros(100, dtype=torch.float32)
    >>> simsimd.l2(a, b, dtype='bfloat16', out=c)
"""
# no imports

# Variables with simple values

__version__ = '6.2.1'

# functions

def bilinear(a, b, metric_tensor, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute the bilinear form between two vectors given a metric tensor.
    
    Args:
        a (NDArray): First vector.
        b (NDArray): Second vector.
        metric_tensor (NDArray): The metric tensor defining the bilinear form.
        dtype (FloatType, optional): Override the presumed input type name.
    
    Returns:
        float: The bilinear form.
    
    Equivalent to: `numpy.dot` with a metric tensor.
    Signature:
        >>> def bilinear(a, b, metric_tensor, /, dtype) -> float: ...
    """
    pass

def cdist(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute pairwise distances between two sets of input matrices.
    
    Args:
        a (NDArray): First matrix.
        b (NDArray): Second matrix.
        metric (str, optional): Distance metric to use (e.g., 'sqeuclidean', 'cosine').
        out (NDArray, optional): Output matrix to store the result.
        dtype (Union[IntegralType, FloatType, ComplexType], optional): Override the presumed input type name.
        out_dtype (Union[FloatType, ComplexType], optional): Result type, default is 'float64'.
    
        threads (int, optional): Number of threads to use (default is 1).
    Returns:
        DistancesTensor: Pairwise distances between all inputs.
    
    Equivalent to: `scipy.spatial.distance.cdist`.
    Signature:
        >>> def cdist(a, b, /, metric, *, dtype, out, out_dtype, threads) -> Optional[DistancesTensor]: ...
    """
    pass

def cos(*args, **kwargs): # real signature unknown
    """
    Compute cosine (angular) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.cosine`.
    Signature:
        >>> def cosine(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def cosine(angular): # real signature unknown; restored from __doc__
    """
    Compute cosine (angular) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.cosine`.
    Signature:
        >>> def cosine(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def disable_capability(*args, **kwargs): # real signature unknown
    """
    Disable a specific SIMD kernel family.
    
    Args:
        capability (str): The name of the SIMD feature to disable (e.g., 'haswell').
    """
    pass

def dot(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute the inner (dot) product between two matrices (real or complex).
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType, ComplexType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (Union[FloatType, ComplexType], optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `numpy.inner`.
    Signature:
        >>> def dot(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def enable_capability(*args, **kwargs): # real signature unknown
    """
    Enable a specific SIMD kernel family.
    
    Args:
        capability (str): The name of the SIMD feature to enable (e.g., 'haswell').
    """
    pass

def euclidean(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute Euclidean (L2) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.euclidean`.
    Signature:
        >>> def euclidean(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def fma(a, b, c, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Fused-Multiply-Add between 3 input vectors.
    
    Args:
        a (NDArray): First vector.
        b (NDArray): Second vector.
        c (NDArray): Third vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed numeric type name.
        alpha (float, optional): First scale, 1.0 by default.
        beta (float, optional): Second scale, 1.0 by default.
        out (NDArray, optional): Vector for resulting distances.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `alpha * a * b + beta * c`.
    Signature:
        >>> def fma(a, b, c, /, dtype, *, alpha, beta, out) -> Optional[DistancesTensor]: ...
    """
    pass

def get_capabilities(*args, **kwargs): # real signature unknown
    """
    Get the current hardware SIMD capabilities as a dictionary of feature flags.
    On x86 includes: 'serial', 'haswell', 'skylake', 'ice', 'genoa', 'sapphire', 'turin'.
    On Arm includes: 'serial', 'neon', 'sve', 'sve2', and their extensions.
    """
    pass

def hamming(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute Hamming distances between two matrices.
    
    Args:
        a (NDArray): First binary matrix or vector.
        b (NDArray): Second binary matrix or vector.
        dtype (IntegralType, optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Similar to: `scipy.spatial.distance.hamming`.
    Signature:
        >>> def hamming(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def inner(dot): # real signature unknown; restored from __doc__
    """
    Compute the inner (dot) product between two matrices (real or complex).
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType, ComplexType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (Union[FloatType, ComplexType], optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `numpy.inner`.
    Signature:
        >>> def dot(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def intersect(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute the intersection of two sorted integer arrays.
    
    Args:
        a (NDArray): First sorted integer array.
        b (NDArray): Second sorted integer array.
    
    Returns:
        float: The number of intersecting elements.
    
    Similar to: `numpy.intersect1d`.Signature:
        >>> def intersect(a, b, /) -> float: ...
    """
    pass

def jaccard(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute Jaccard distances (bitwise Tanimoto) between two matrices.
    
    Args:
        a (NDArray): First binary matrix or vector.
        b (NDArray): Second binary matrix or vector.
        dtype (IntegralType, optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Similar to: `scipy.spatial.distance.jaccard`.
    Signature:
        >>> def jaccard(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def jensenshannon(*args, **kwargs): # real signature unknown
    """
    Compute Jensen-Shannon divergences between two matrices.
    
    Args:
        a (NDArray): First floating-point matrix or vector.
        b (NDArray): Second floating-point matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.jensenshannon`.
    Signature:
        >>> def kl(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def js(*args, **kwargs): # real signature unknown
    """
    Compute Jensen-Shannon divergences between two matrices.
    
    Args:
        a (NDArray): First floating-point matrix or vector.
        b (NDArray): Second floating-point matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.jensenshannon`.
    Signature:
        >>> def kl(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def kl(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute Kullback-Leibler divergences between two matrices.
    
    Args:
        a (NDArray): First floating-point matrix or vector.
        b (NDArray): Second floating-point matrix or vector.
        dtype (FloatType, optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.special.kl_div`.
    Signature:
        >>> def kl(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def kullbackleibler(*args, **kwargs): # real signature unknown
    """
    Compute Kullback-Leibler divergences between two matrices.
    
    Args:
        a (NDArray): First floating-point matrix or vector.
        b (NDArray): Second floating-point matrix or vector.
        dtype (FloatType, optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.special.kl_div`.
    Signature:
        >>> def kl(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def l2(*args, **kwargs): # real signature unknown
    """
    Compute Euclidean (L2) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.euclidean`.
    Signature:
        >>> def euclidean(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def l2sq(*args, **kwargs): # real signature unknown
    """
    Compute squared Euclidean (L2) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.sqeuclidean`.
    Signature:
        >>> def sqeuclidean(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def mahalanobis(a, b, inverse_covariance, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute the Mahalanobis distance between two vectors given an inverse covariance matrix.
    
    Args:
        a (NDArray): First vector.
        b (NDArray): Second vector.
        inverse_covariance (NDArray): The inverse of the covariance matrix.
        dtype (FloatType, optional): Override the presumed input type name.
    
    Returns:
        float: The Mahalanobis distance.
    
    Equivalent to: `scipy.spatial.distance.mahalanobis`.
    Signature:
        >>> def mahalanobis(a, b, inverse_covariance, /, dtype) -> float: ...
    """
    pass

def pointer_to_cosine(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.cos` kernel. """
    pass

def pointer_to_dot(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.dot` kernel. """
    pass

def pointer_to_euclidean(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.l2` kernel. """
    pass

def pointer_to_inner(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.dot` kernel. """
    pass

def pointer_to_jensenshannon(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.js` kernel. """
    pass

def pointer_to_kullbackleibler(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.kl` kernel. """
    pass

def pointer_to_sqeuclidean(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.l2sq` kernel. """
    pass

def pointer_to_vdot(*args, **kwargs): # real signature unknown
    """ Get (int) pointer to the `simsimd.vdot` kernel. """
    pass

def sqeuclidean(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute squared Euclidean (L2) distances between two matrices.
    
    Args:
        a (NDArray): First matrix or vector.
        b (NDArray): Second matrix or vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (FloatType, optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `scipy.spatial.distance.sqeuclidean`.
    Signature:
        >>> def sqeuclidean(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def vdot(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Compute the conjugate dot product between two complex matrices.
    
    Args:
        a (NDArray): First complex matrix or vector.
        b (NDArray): Second complex matrix or vector.
        dtype (ComplexType, optional): Override the presumed input type name.
        out (NDArray, optional): Vector for resulting distances. Allocates a new tensor by default.
        out_dtype (Union[ComplexType], optional): Result type, default is 'float64'.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `numpy.vdot`.
    Signature:
        >>> def vdot(a, b, /, dtype, *, out, out_dtype) -> Optional[DistancesTensor]: ...
    """
    pass

def wsum(a, b, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ 
    """
    Weighted Sum of 2 input vectors.
    
    Args:
        a (NDArray): First vector.
        b (NDArray): Second vector.
        dtype (Union[IntegralType, FloatType], optional): Override the presumed numeric type name.
        alpha (float, optional): First scale, 1.0 by default.
        beta (float, optional): Second scale, 1.0 by default.
        out (NDArray, optional): Vector for resulting distances.
    
    Returns:
        DistancesTensor: The distances if `out` is not provided.
        None: If `out` is provided. Operation will per performed in-place.
    
    Equivalent to: `alpha * a + beta * b`.
    Signature:
        >>> def wsum(a, b, /, dtype, *, alpha, beta, out) -> Optional[DistancesTensor]: ...
    """
    pass

# classes

class DistancesTensor(object):
    """ Zero-copy view of an internal tensor, compatible with NumPy """
    def __buffer__(self, *args, **kwargs): # real signature unknown
        """ Return a buffer object that exposes the underlying memory of the object. """
        pass

    def __init__(self, *args, **kwargs): # real signature unknown
        pass

    def __release_buffer__(self, *args, **kwargs): # real signature unknown
        """ Release the buffer object that exposes the underlying memory of the object. """
        pass


# variables with complex values

__loader__ = None # (!) real value is '<_frozen_importlib_external.ExtensionFileLoader object at 0x00000196EE4E9260>'

__spec__ = None # (!) real value is "ModuleSpec(name='simsimd', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x00000196EE4E9260>, origin='C:\\\\Programs\\\\Python\\\\Python313\\\\Lib\\\\site-packages\\\\simsimd.cp313-win_amd64.pyd')"

