o
    }oi
                     @   s.   d dl Z d dlZd dlmZ G dd dZdS )    N)ASRModelc                   @   s&   e Zd Zej ejjdd ZdS )TestASRSubsamplingConvChunkingc                 C   sF  t d}| }d|jj_d|jj_d}tjd|f|j	d}tj
dddg|j	d	}tjd
|f|j	d}tj
ddd
g|j	d	}t 6 |j||d\}}}|j||d\}	}}|jdd |j||d\}
}}|j||d\}}}W d    n1 s|w   Y  tt|
| }|dksJ tt||	 }|dksJ d S )Nstt_en_fastconformer_ctc_largeg        r   i      )sizedevice   i  )lowhighr   r      )input_signalinput_signal_length   ) subsampling_conv_chunking_factorgư>)r   from_pretrainedevalpreprocessor
featurizerditherpad_totorchrandnr   randintno_gradforward'change_subsampling_conv_chunking_factormeanabsmax)self	asr_modelleninput_signal_batch1length_batch1input_signal_batch4length_batch4logprobs_batch1_nosplit_logprobs_batch4_nosplitlogprobs_batch1_splitlogprobs_batch4_splitdiff r,   ^/home/ubuntu/.local/lib/python3.10/site-packages/tests/collections/asr/test_asr_subsampling.pytest_forward   s8   



z+TestASRSubsamplingConvChunking.test_forwardN)__name__
__module____qualname__pytestmarkwith_downloadsunitr.   r,   r,   r,   r-   r      s    r   )r2   r   nemo.collections.asr.modelsr   r   r,   r,   r,   r-   <module>   s   