o
    
j                     @   s   dddZ dS )Fc                 C   s8   | j ddd }|rd||dk< |jddjdd S )aU  
    Compute how diagonal alignment predictions are. It is useful
    to measure the alignment consistency of a model
    Args:
        alignments (torch.Tensor): batch of alignments.
        binary (bool): if True, ignore scores and consider attention
        as a binary mask.
    Shape:
        - alignments : :math:`[B, T_de, T_en]`
       )dim    )maxmeanitem)
alignmentsbinarymaxs r
   I/home/kuhnn/.local/lib/python3.10/site-packages/TTS/tts/utils/measures.pyalignment_diagonal_score   s   r   N)F)r   r
   r
   r
   r   <module>   s    