
    .`i                         d Z ddlZddlmZ  ej        dej                  dej        dej        dej        fd	            ZdS )
z.Some utilities for logprobs, including logits.    N)current_platformT)dynamicbackendxvaluesreturnc                 4    | |k                         d          S )a   
    Counts elements in each row of x that are greater than the corresponding
    value in values.  Use torch.compile to generate an optimized kernel for
    this function. otherwise, it will create additional copies of the input
    tensors and cause memory issues.

    Args:
        x (torch.Tensor): A 2D tensor of shape (batch_size, n_elements).
        values (torch.Tensor): A 2D tensor of shape (batch_size, 1).

    Returns:
        torch.Tensor: A 1D tensor of shape (batch_size,) with the counts.
    )sum)r   r   s     o/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/v1/sample/ops/logprobs.pybatched_count_greater_thanr   
   s     KR       )__doc__torchvllm.platformsr   compilesimple_compile_backendTensorr    r   r   <module>r      s    5 4  + + + + + + t%5%LMMM!%, ! ! ! ! ! NM! ! !r   