§
    @Äjï=  ã                   ó  — d dl Z d dlmZmZmZ d dlZd dlmc mZ	 d dlmZm
Z
 g d¢Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d	„ d
ej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        ZdS )é    N)ÚListÚOptionalÚTuple)ÚnnÚTensor)ÚResBlockÚ	MelResNetÚ	Stretch2dÚUpsampleNetworkÚWaveRNNc                   ó>   ‡ — e Zd ZdZd	deddfˆ fd„Zdedefd„Zˆ xZS )
r   af  ResNet block based on *Efficient Neural Audio Synthesis* :cite:`kalchbrenner2018efficient`.

    Args:
        n_freq: the number of bins in a spectrogram. (Default: ``128``)

    Examples
        >>> resblock = ResBlock()
        >>> input = torch.rand(10, 128, 512)  # a random spectrogram
        >>> output = resblock(input)  # shape: (10, 128, 512)
    é€   Ún_freqÚreturnNc                 óH  •— t          ¦   «                              ¦   «          t          j        t          j        ||dd¬¦  «        t          j        |¦  «        t          j        d¬¦  «        t          j        ||dd¬¦  «        t          j        |¦  «        ¦  «        | _        d S )Né   F©Úin_channelsÚout_channelsÚkernel_sizeÚbiasT©Úinplace)ÚsuperÚ__init__r   Ú
SequentialÚConv1dÚBatchNorm1dÚReLUÚresblock_model)Úselfr   Ú	__class__s     €úJC:\Projects\Historical\venv\Lib\site-packages\torchaudio/models/wavernn.pyr   zResBlock.__init__   s‹   ø€ Ý‰Œ×ÒÑÔÐå œmÝŒI &°vÈ1ÐSXÐYÑYÔYÝŒN˜6Ñ"Ô"ÝŒG˜DÐ!Ñ!Ô!ÝŒI &°vÈ1ÐSXÐYÑYÔYÝŒN˜6Ñ"Ô"ñ
ô 
ˆÔÐÐó    Úspecgramc                 ó2   — |                       |¦  «        |z   S )zéPass the input through the ResBlock layer.
        Args:
            specgram (Tensor): the input sequence to the ResBlock layer (n_batch, n_freq, n_time).

        Return:
            Tensor shape: (n_batch, n_freq, n_time)
        )r    ©r!   r%   s     r#   ÚforwardzResBlock.forward(   s   € ð ×"Ò" 8Ñ,Ô,¨xÑ7Ð7r$   )r   ©	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úintr   r   r(   Ú__classcell__©r"   s   @r#   r   r      s|   ø€ € € € € ð	ð 	ð	
ð 	
˜sð 	
¨Tð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð	8 ð 	8¨6ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8r$   r   c                   óP   ‡ — e Zd ZdZ	 ddedededed	ed
dfˆ fd„Zded
efd„Zˆ xZS )r	   a�  MelResNet layer uses a stack of ResBlocks on spectrogram.

    Args:
        n_res_block: the number of ResBlock in stack. (Default: ``10``)
        n_freq: the number of bins in a spectrogram. (Default: ``128``)
        n_hidden: the number of hidden dimensions of resblock. (Default: ``128``)
        n_output: the number of output dimensions of melresnet. (Default: ``128``)
        kernel_size: the number of kernel size in the first Conv1d layer. (Default: ``5``)

    Examples
        >>> melresnet = MelResNet()
        >>> input = torch.rand(10, 128, 512)  # a random spectrogram
        >>> output = melresnet(input)  # shape: (10, 128, 508)
    é
   r   é   Ún_res_blockr   Ún_hiddenÚn_outputr   r   Nc                 óV  •‡— t          ¦   «                              ¦   «          ˆfd„t          |¦  «        D ¦   «         }t          j        t          j        |‰|d¬¦  «        t          j        ‰¦  «        t          j        d¬¦  «        g|¢t          j        ‰|d¬¦  «        ‘R Ž | _        d S )Nc                 ó.   •— g | ]}t          ‰¦  «        ‘ŒS © )r   )Ú.0Ú_r5   s     €r#   ú
<listcomp>z&MelResNet.__init__.<locals>.<listcomp>I   s!   ø€ ÐDÐDÐD¨A•X˜hÑ'Ô'ÐDÐDÐDr$   Fr   Tr   r   )r   r   r   )	r   r   Úranger   r   r   r   r   Úmelresnet_model)r!   r4   r   r5   r6   r   Ú	ResBlocksr"   s      `   €r#   r   zMelResNet.__init__D   sµ   øø€ õ 	‰Œ×ÒÑÔÐàDÐDÐDÐDµ°{Ñ1CÔ1CÐDÑDÔDˆ	å!œ}ÝŒI &°xÈ[Ð_dÐeÑeÔeÝŒN˜8Ñ$Ô$ÝŒG˜DÐ!Ñ!Ô!ð 
ð ð	 
õ
 ŒI (¸ÈqÐQÑQÔQð 
ð  
ð  
ˆÔÐÐr$   r%   c                 ó,   — |                       |¦  «        S )zÿPass the input through the MelResNet layer.
        Args:
            specgram (Tensor): the input sequence to the MelResNet layer (n_batch, n_freq, n_time).

        Return:
            Tensor shape: (n_batch, n_output, n_time - kernel_size + 1)
        )r>   r'   s     r#   r(   zMelResNet.forwardS   s   € ð ×#Ò# HÑ-Ô-Ð-r$   ©r2   r   r   r   r3   r)   r0   s   @r#   r	   r	   4   s¥   ø€ € € € € ðð ð  vwð
ð 
Øð
Ø-0ð
ØBEð
ØWZð
Øorð
à	ð
ð 
ð 
ð 
ð 
ð 
ð	. ð 	.¨6ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.r$   r	   c                   ó@   ‡ — e Zd ZdZdededdfˆ fd„Zdedefd„Zˆ xZS )	r
   a‘  Upscale the frequency and time dimensions of a spectrogram.

    Args:
        time_scale: the scale factor in time dimension
        freq_scale: the scale factor in frequency dimension

    Examples
        >>> stretch2d = Stretch2d(time_scale=10, freq_scale=5)

        >>> input = torch.rand(10, 100, 512)  # a random spectrogram
        >>> output = stretch2d(input)  # shape: (10, 500, 5120)
    Ú
time_scaleÚ
freq_scaler   Nc                 ód   •— t          ¦   «                              ¦   «          || _        || _        d S ©N)r   r   rD   rC   )r!   rC   rD   r"   s      €r#   r   zStretch2d.__init__m   s+   ø€ Ý‰Œ×ÒÑÔÐà$ˆŒØ$ˆŒˆˆr$   r%   c                 ój   — |                      | j        d¦  «                              | j        d¦  «        S )zþPass the input through the Stretch2d layer.

        Args:
            specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).

        Return:
            Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)
        éþÿÿÿéÿÿÿÿ)Úrepeat_interleaverD   rC   r'   s     r#   r(   zStretch2d.forwards   s1   € ð ×)Ò)¨$¬/¸2Ñ>Ô>×PÒPÐQUÔQ`ÐbdÑeÔeÐer$   r)   r0   s   @r#   r
   r
   _   sˆ   ø€ € € € € ðð ð% 3ð %°Cð %¸Dð %ð %ð %ð %ð %ð %ð
f ð 
f¨6ð 
fð 
fð 
fð 
fð 
fð 
fð 
fð 
fr$   r
   c                   óx   ‡ — e Zd ZdZ	 	 	 	 	 ddee         dededed	ed
eddfˆ fd„Zdedeeef         fd„Z	ˆ xZ
S )r   añ  Upscale the dimensions of a spectrogram.

    Args:
        upsample_scales: the list of upsample scales.
        n_res_block: the number of ResBlock in stack. (Default: ``10``)
        n_freq: the number of bins in a spectrogram. (Default: ``128``)
        n_hidden: the number of hidden dimensions of resblock. (Default: ``128``)
        n_output: the number of output dimensions of melresnet. (Default: ``128``)
        kernel_size: the number of kernel size in the first Conv1d layer. (Default: ``5``)

    Examples
        >>> upsamplenetwork = UpsampleNetwork(upsample_scales=[4, 4, 16])
        >>> input = torch.rand(10, 128, 10)  # a random spectrogram
        >>> output = upsamplenetwork(input)  # shape: (10, 128, 1536), (10, 128, 1536)
    r2   r   r3   Úupsample_scalesr4   r   r5   r6   r   r   Nc                 ó<  •— t          ¦   «                              ¦   «          d}|D ]}||z  }Œ|| _        |dz
  dz  |z  | _        t	          |||||¦  «        | _        t          |d¦  «        | _        g }	|D ]’}
t          |
d¦  «        }t          j	        ddd|
dz  dz   fd|
fd¬¦  «        }t          j        j                             |j        d|
dz  dz   z  ¦  «         |	                     |¦  «         |	                     |¦  «         Œ“t          j        |	Ž | _        d S )Nr   é   r   F)r   r   r   Úpaddingr   ç      ð?)r   r   Útotal_scaleÚindentr	   Úresnetr
   Úresnet_stretchr   ÚConv2dÚtorchÚinitÚ	constant_ÚweightÚappendr   Úupsample_layers)r!   rL   r4   r   r5   r6   r   rQ   Úupsample_scaleÚ	up_layersÚscaleÚstretchÚconvr"   s                €r#   r   zUpsampleNetwork.__init__‘   sE  ø€ õ 	‰Œ×ÒÑÔÐàˆØ-ð 	*ð 	*ˆNØ˜>Ñ)ˆKˆKØ +ˆÔà" Q‘¨1Ñ,¨{Ñ:ˆŒÝ ¨V°X¸xÈÑUÔUˆŒÝ'¨°QÑ7Ô7ˆÔàˆ	Ø$ð 	#ð 	#ˆEÝ  qÑ)Ô)ˆGÝ”9Ø¨A¸A¸uÀq¹yÈ1¹}Ð;MÐXYÐ[`ÐWaÐhmðñ ô ˆDõ ŒHŒM×#Ò# D¤K°¸À¹	ÀA¹Ñ1FÑGÔGÐGØ×Ò˜WÑ%Ô%Ð%Ø×Ò˜TÑ"Ô"Ð"Ð"Ý!œ}¨iÐ8ˆÔÐÐr$   r%   c                 ó`  — |                       |¦  «                             d¦  «        }|                      |¦  «        }|                     d¦  «        }|                     d¦  «        }|                      |¦  «        }|                     d¦  «        dd…dd…| j        | j         …f         }||fS )a¿  Pass the input through the UpsampleNetwork layer.

        Args:
            specgram (Tensor): the input sequence to the UpsampleNetwork layer (n_batch, n_freq, n_time)

        Return:
            Tensor shape: (n_batch, n_freq, (n_time - kernel_size + 1) * total_scale),
                          (n_batch, n_output, (n_time - kernel_size + 1) * total_scale)
        where total_scale is the product of all elements in upsample_scales.
        r   N)rS   Ú	unsqueezerT   Úsqueezer[   rR   )r!   r%   Úresnet_outputÚupsampling_outputs       r#   r(   zUpsampleNetwork.forward°   s®   € ð Ÿš HÑ-Ô-×7Ò7¸Ñ:Ô:ˆØ×+Ò+¨MÑ:Ô:ˆØ%×-Ò-¨aÑ0Ô0ˆà×%Ò% aÑ(Ô(ˆØ ×0Ò0°Ñ:Ô:ÐØ-×5Ò5°aÑ8Ô8¸¸¸¸A¸A¸A¸t¼{ÈdÌkÈ\Ð?YÐ9YÔZÐà  -Ð/Ð/r$   rA   )r*   r+   r,   r-   r   r.   r   r   r   r(   r/   r0   s   @r#   r   r   €   sÐ   ø€ € € € € ðð ð& ØØØØð9ð 9à˜cœð9ð ð9ð ð	9ð
 ð9ð ð9ð ð9ð 
ð9ð 9ð 9ð 9ð 9ð 9ð>0 ð 0¨5°¸°Ô+@ð 0ð 0ð 0ð 0ð 0ð 0ð 0ð 0r$   r   c                   óâ   ‡ — e Zd ZdZ	 	 	 	 	 	 	 ddee         deded	ed
ededededededdfˆ fd„Zdededefd„Ze	j
        j        ddedee         deeee         f         fd„¦   «         Zˆ xZS )r   aW  WaveRNN model from *Efficient Neural Audio Synthesis* :cite:`wavernn`
    based on the implementation from `fatchord/WaveRNN <https://github.com/fatchord/WaveRNN>`_.

    The original implementation was introduced in *Efficient Neural Audio Synthesis*
    :cite:`kalchbrenner2018efficient`. The input channels of waveform and spectrogram have to be 1.
    The product of `upsample_scales` must equal `hop_length`.

    See Also:
        * `Training example <https://github.com/pytorch/audio/tree/release/0.12/examples/pipeline_wavernn>`__
        * :class:`torchaudio.pipelines.Tacotron2TTSBundle`: TTS pipeline with pretrained model.

    Args:
        upsample_scales: the list of upsample scales.
        n_classes: the number of output classes.
        hop_length: the number of samples between the starts of consecutive frames.
        n_res_block: the number of ResBlock in stack. (Default: ``10``)
        n_rnn: the dimension of RNN layer. (Default: ``512``)
        n_fc: the dimension of fully connected layer. (Default: ``512``)
        kernel_size: the number of kernel size in the first Conv1d layer. (Default: ``5``)
        n_freq: the number of bins in a spectrogram. (Default: ``128``)
        n_hidden: the number of hidden dimensions of resblock. (Default: ``128``)
        n_output: the number of output dimensions of melresnet. (Default: ``128``)

    Example
        >>> wavernn = WaveRNN(upsample_scales=[5,5,8], n_classes=512, hop_length=200)
        >>> waveform, sample_rate = torchaudio.load(file)
        >>> # waveform shape: (n_batch, n_channel, (n_time - kernel_size + 1) * hop_length)
        >>> specgram = MelSpectrogram(sample_rate)(waveform)  # shape: (n_batch, n_channel, n_freq, n_time)
        >>> output = wavernn(waveform, specgram)
        >>> # output shape: (n_batch, n_channel, (n_time - kernel_size + 1) * hop_length, n_classes)
    r2   é   r3   r   rL   Ú	n_classesÚ
hop_lengthr4   Ún_rnnÚn_fcr   r   r5   r6   r   Nc                 ó”  •— t          ¦   «                              ¦   «          || _        |dz  r|dz
  n|dz  | _        || _        |
dz  | _        || _        || _        t          t          j
        | j        ¦  «        ¦  «        | _        d}|D ]}||z  }Œ|| j        k    rt          d|› d|› �¦  «        ‚t          ||||	|
|¦  «        | _        t          j        || j        z   dz   |¦  «        | _        t          j        ||d¬¦  «        | _        t          j        || j        z   |d¬¦  «        | _        t          j        d¬¦  «        | _        t          j        d¬¦  «        | _        t          j        || j        z   |¦  «        | _        t          j        || j        z   |¦  «        | _        t          j        || j        ¦  «        | _        d S )	NrN   r   é   z/Expected: total_scale == hop_length, but found z != T)Úbatch_firstr   )r   r   r   Ú_padrj   Ún_auxri   rh   r.   ÚmathÚlog2Ún_bitsÚ
ValueErrorr   Úupsampler   ÚLinearÚfcÚGRUÚrnn1Úrnn2r   Úrelu1Úrelu2Úfc1Úfc2Úfc3)r!   rL   rh   ri   r4   rj   rk   r   r   r5   r6   rQ   r\   r"   s                €r#   r   zWaveRNN.__init__è   s®  ø€ õ 	‰Œ×ÒÑÔÐà&ˆÔØ(3°a©ÐH�[ 1‘_�_¸[ÈQÑNˆŒ	ØˆŒ
Ø ‘]ˆŒ
Ø$ˆŒØ"ˆŒÝ�tœy¨¬Ñ8Ô8Ñ9Ô9ˆŒàˆØ-ð 	*ð 	*ˆNØ˜>Ñ)ˆKˆKØ˜$œ/Ò)Ð)ÝÐlÈ{ÐlÐlÐ`jÐlÐlÑmÔmÐmå'¨¸ÀfÈhÐX`ÐbmÑnÔnˆŒÝ”)˜F T¤ZÑ/°!Ñ3°UÑ;Ô;ˆŒå”F˜5 %°TÐ:Ñ:Ô:ˆŒ	Ý”F˜5 4¤:Ñ-¨uÀ$ÐGÑGÔGˆŒ	å”W TÐ*Ñ*Ô*ˆŒ
Ý”W TÐ*Ñ*Ô*ˆŒ
å”9˜U T¤ZÑ/°Ñ6Ô6ˆŒÝ”9˜T D¤JÑ.°Ñ5Ô5ˆŒÝ”9˜T 4¤>Ñ2Ô2ˆŒˆˆr$   Úwaveformr%   c                 óö  ‡ — |                      d¦  «        dk    rt          d¦  «        ‚|                      d¦  «        dk    rt          d¦  «        ‚|                     d¦  «        |                     d¦  «        }}|                      d¦  «        }t          j        d|‰ j        |j        |j        ¬¦  «        }t          j        d|‰ j        |j        |j        ¬¦  «        }‰                      |¦  «        \  }}| 	                    dd¦  «        }| 	                    dd¦  «        }ˆ fd„t          d¦  «        D ¦   «         }|d	d	…d	d	…|d         |d         …f         }|d	d	…d	d	…|d         |d         …f         }	|d	d	…d	d	…|d         |d
         …f         }
|d	d	…d	d	…|d
         |d         …f         }t          j        |                     d¦  «        ||gd¬¦  «        }‰                      |¦  «        }|}‰                      ||¦  «        \  }}||z   }|}t          j        ||	gd¬¦  «        }‰                      ||¦  «        \  }}||z   }t          j        ||
gd¬¦  «        }‰                      |¦  «        }‰                      |¦  «        }t          j        ||gd¬¦  «        }‰                      |¦  «        }‰                      |¦  «        }‰                      |¦  «        }|                     d¦  «        S )a  Pass the input through the WaveRNN model.

        Args:
            waveform: the input waveform to the WaveRNN layer (n_batch, 1, (n_time - kernel_size + 1) * hop_length)
            specgram: the input spectrogram to the WaveRNN layer (n_batch, 1, n_freq, n_time)

        Return:
            Tensor: shape (n_batch, 1, (n_time - kernel_size + 1) * hop_length, n_classes)
        r   z*Require the input channel of waveform is 1z*Require the input channel of specgram is 1r   )ÚdtypeÚdevicerN   c                 ó$   •— g | ]}‰j         |z  ‘ŒS r9   ©rp   )r:   Úir!   s     €r#   r<   z#WaveRNN.forward.<locals>.<listcomp>.  s   ø€ Ð4Ð4Ð4 a�4”: ‘>Ð4Ð4Ð4r$   r3   Né   rm   rI   ©Údim)Úsizert   rc   rV   Úzerosrj   r‚   rƒ   ru   Ú	transposer=   Úcatrb   rw   ry   rz   r}   r{   r~   r|   r   )r!   r€   r%   Ú
batch_sizeÚh1Úh2ÚauxÚaux_idxÚa1Úa2Úa3Úa4ÚxÚresr;   s   `              r#   r(   zWaveRNN.forward  sè  ø€ ð �=Š=˜ÑÔ˜qÒ Ð ÝÐIÑJÔJÐJØ�=Š=˜ÑÔ˜qÒ Ð ÝÐIÑJÔJÐJà%×-Ò-¨aÑ0Ô0°(×2BÒ2BÀ1Ñ2EÔ2E�(ˆà—]’] 1Ñ%Ô%ˆ
ÝŒ[˜˜J¨¬
¸(¼.ÐQYÔQ`ÐaÑaÔaˆÝŒ[˜˜J¨¬
¸(¼.ÐQYÔQ`ÐaÑaÔaˆð Ÿš hÑ/Ô/‰ˆ�#Ø×%Ò% a¨Ñ+Ô+ˆØ�mŠm˜A˜qÑ!Ô!ˆà4Ð4Ð4Ð4­5°©8¬8Ð4Ñ4Ô4ˆØ����A�A�A�w˜q”z G¨A¤JÐ.Ð.Ô/ˆØ����A�A�A�w˜q”z G¨A¤JÐ.Ð.Ô/ˆØ����A�A�A�w˜q”z G¨A¤JÐ.Ð.Ô/ˆØ����A�A�A�w˜q”z G¨A¤JÐ.Ð.Ô/ˆåŒI�x×)Ò)¨"Ñ-Ô-¨x¸Ð<À"ÐEÑEÔEˆØ�GŠG�A‰JŒJˆØˆØ�yŠy˜˜BÑÔ‰ˆˆ1à�‰GˆØˆÝŒI�q˜"�g 2Ð&Ñ&Ô&ˆØ�yŠy˜˜BÑÔ‰ˆˆ1à�‰GˆÝŒI�q˜"�g 2Ð&Ñ&Ô&ˆØ�HŠH�Q‰KŒKˆØ�JŠJ�q‰MŒMˆåŒI�q˜"�g 2Ð&Ñ&Ô&ˆØ�HŠH�Q‰KŒKˆØ�JŠJ�q‰MŒMˆØ�HŠH�Q‰KŒKˆð �{Š{˜1‰~Œ~Ðr$   Úlengthsc                 ó  ‡ ‡‡— |j         }|j        }t          j        j                             |‰ j        ‰ j        f¦  «        }‰                      |¦  «        \  }Š|�|‰ j        j        z  }g }| 	                    ¦   «         \  }}}t          j
        d|‰ j        f||¬¦  «        }	t          j
        d|‰ j        f||¬¦  «        }
t          j
        |df||¬¦  «        }ˆˆ fd„t          d¦  «        D ¦   «         }t          |¦  «        D �]ÔŠ|dd…dd…‰f         }ˆfd„|D ¦   «         \  }}}}t          j        |||gd¬¦  «        }‰                      |¦  «        }‰                      |                     d¦  «        |	¦  «        \  }}	||	d         z   }t          j        ||gd¬¦  «        }‰                      |                     d¦  «        |
¦  «        \  }}
||
d         z   }t          j        ||gd¬¦  «        }t%          j        ‰                      |¦  «        ¦  «        }t          j        ||gd¬¦  «        }t%          j        ‰                      |¦  «        ¦  «        }‰                      |¦  «        }t%          j        |d¬¦  «        }t          j        |d¦  «                             ¦   «         }d	|z  d	‰ j        z  d
z
  z  d
z
  }|                     |¦  «         �ŒÖt          j        |¦  «                             dd	d¦  «        |fS )a¾  Inference method of WaveRNN.

        This function currently only supports multinomial sampling, which assumes the
        network is trained on cross entropy loss.

        Args:
            specgram (Tensor):
                Batch of spectrograms. Shape: `(n_batch, n_freq, n_time)`.
            lengths (Tensor or None, optional):
                Indicates the valid length of each audio in the batch.
                Shape: `(batch, )`.
                When the ``specgram`` contains spectrograms with different durations,
                by providing ``lengths`` argument, the model will compute
                the corresponding valid output lengths.
                If ``None``, it is assumed that all the audio in ``waveforms``
                have valid length. Default: ``None``.

        Returns:
            (Tensor, Optional[Tensor]):
            Tensor
                The inferred waveform of size `(n_batch, 1, n_time)`.
                1 stands for a single channel.
            Tensor or None
                If ``lengths`` argument was provided, a Tensor of shape `(batch, )`
                is returned.
                It indicates the valid length in time axis of the output Tensor.
        Nr   )rƒ   r‚   c                 óX   •— g | ]&}‰d d …‰j         |z  ‰j         |dz   z  …d d …f         ‘Œ'S )Nr   r…   )r:   r†   r‘   r!   s     €€r#   r<   z!WaveRNN.infer.<locals>.<listcomp>x  sC   ø€ ÐXÐXÐXÈ!�S˜˜˜˜DœJ¨™N¨T¬Z¸1¸q¹5Ñ-AÐAÀ1À1À1ÐDÔEÐXÐXÐXr$   rm   c                 ó.   •— g | ]}|d d …d d …‰f         ‘ŒS rF   r9   )r:   Úar†   s     €r#   r<   z!WaveRNN.infer.<locals>.<listcomp>~  s+   ø€ Ð%DÐ%DÐ%D°Q a¨¨¨¨1¨1¨1¨a¨¤jÐ%DÐ%DÐ%Dr$   rˆ   r   rN   rP   )rƒ   r‚   rV   r   Ú
functionalÚpadro   ru   rQ   rŠ   r‹   rj   r=   r�   rw   ry   rb   rz   ÚFÚrelur}   r~   r   ÚsoftmaxÚmultinomialÚfloatrs   rZ   ÚstackÚpermute)r!   r%   r™   rƒ   r‚   ÚoutputÚb_sizer;   Úseq_lenr�   r�   r—   Ú	aux_splitÚm_tÚa1_tÚa2_tÚa3_tÚa4_tÚinpÚlogitsÚ	posteriorr‘   r†   s   `                    @@r#   ÚinferzWaveRNN.inferK  sá  øøø€ ð< ”ˆØ”ˆå”8Ô&×*Ò*¨8°d´iÀÄÐ5KÑLÔLˆØŸš hÑ/Ô/‰ˆ�#ØÐØ ¤Ô 9Ñ9ˆGà!ˆØ%Ÿ]š]™_œ_Ñˆ��7åŒ[˜!˜V T¤ZÐ0¸ÀuÐMÑMÔMˆÝŒ[˜!˜V T¤ZÐ0¸ÀuÐMÑMÔMˆÝŒK˜ ˜¨F¸%Ð@Ñ@Ô@ˆàXÐXÐXÐXÐXÍuÐUVÉxÌxÐXÑXÔXˆ	å�w‘”ð 	ñ 	ˆAà˜1˜1˜1˜a˜a˜a ˜7Ô#ˆCà%DÐ%DÐ%DÐ%D¸)Ð%DÑ%DÔ%DÑ"ˆD�$˜˜då”	˜1˜c 4˜.¨aÐ0Ñ0Ô0ˆAØ—’˜‘
”
ˆAØ—I’I˜aŸkšk¨!™nœn¨bÑ1Ô1‰EˆAˆrà�B�q”E‘	ˆAÝ”)˜Q ˜I¨1Ð-Ñ-Ô-ˆCØ—I’I˜cŸmšm¨AÑ.Ô.°Ñ3Ô3‰EˆAˆrà�B�q”E‘	ˆAÝ”	˜1˜d˜)¨Ð+Ñ+Ô+ˆAÝ”�t—x’x ‘{”{Ñ#Ô#ˆAå”	˜1˜d˜)¨Ð+Ñ+Ô+ˆAÝ”�t—x’x ‘{”{Ñ#Ô#ˆAà—X’X˜a‘[”[ˆFåœ	 &¨aÐ0Ñ0Ô0ˆIåÔ! )¨QÑ/Ô/×5Ò5Ñ7Ô7ˆAà�A‘˜˜DœK™¨#Ñ-Ñ.°Ñ4ˆAà�MŠM˜!ÑÔÐÑåŒ{˜6Ñ"Ô"×*Ò*¨1¨a°Ñ3Ô3°WÐ<Ð<r$   )r2   rg   rg   r3   r   r   r   rF   )r*   r+   r,   r-   r   r.   r   r   r(   rV   ÚjitÚexportr   r   r³   r/   r0   s   @r#   r   r   Ç   sb  ø€ € € € € ðð ðJ ØØØØØØð(3ð (3à˜cœð(3ð ð(3ð ð	(3ð
 ð(3ð ð(3ð ð(3ð ð(3ð ð(3ð ð(3ð ð(3ð 
ð(3ð (3ð (3ð (3ð (3ð (3ðT7 ð 7°&ð 7¸Vð 7ð 7ð 7ð 7ðr „YÔðM=ð M=˜fð M=¨x¸Ô/?ð M=È5ÐQWÐYaÐbhÔYiÐQiÔKjð M=ð M=ð M=ñ ÔðM=ð M=ð M=ð M=ð M=r$   r   )rq   Útypingr   r   r   rV   Útorch.nn.functionalr   rž   r    r   Ú__all__ÚModuler   r	   r
   r   r   r9   r$   r#   ú<module>rº      s}  ðØ €€€Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ð (à €€€Ø Ð Ð Ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ð Ð ðð ð €ð 8ð  8ð  8ð  8ð  8ˆrŒyñ  8ô  8ð  8ðF(.ð (.ð (.ð (.ð (.�”	ñ (.ô (.ð (.ðVfð fð fð fð f�”	ñ fô fð fðBD0ð D0ð D0ð D0ð D0�b”iñ D0ô D0ð D0ðNR=ð R=ð R=ð R=ð R=ˆbŒiñ R=ô R=ð R=ð R=ð R=r$   