o
    ¡¿¯ií  ã                   @   s,   d dl Z d dlmZ G dd„ de jjƒZdS )é    N)ÚLabelAggregatec                       sH   e Zd ZdZ	ddededef‡ fdd	„Zd
ejdejfdd„Z	‡  Z
S )ÚLabelProcessorz(Label aggregator for speaker diarizationé   é€   TÚ
win_lengthÚ
hop_lengthÚcenterc                    s   t ƒ  ¡  t|||ƒ| _d S )N)ÚsuperÚ__init__r   Úlabel_aggregator)Úselfr   r   r   ©Ú	__class__© úP/home/ubuntu/.local/lib/python3.10/site-packages/espnet2/diar/label_processor.pyr
   	   s   
zLabelProcessor.__init__ÚinputÚilensc                 C   s   |   ||¡\}}||fS )zÇForward.

        Args:
            input: (Batch, Nsamples, Label_dim)
            ilens: (Batch)
        Returns:
            output: (Batch, Frames, Label_dim)
            olens: (Batch)

        )r   )r   r   r   ÚoutputÚolensr   r   r   Úforward   s   zLabelProcessor.forward)r   r   T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚintÚboolr
   ÚtorchÚTensorr   Ú__classcell__r   r   r   r   r      s    ÿÿÿÿr   )r   Ú espnet2.layers.label_aggregationr   ÚnnÚModuler   r   r   r   r   Ú<module>   s    