class_docstr: General class to jointly train score2mel and vocoder parts.
docstr: Run inference.
  
  Args:
      text (Tensor): Input text index tensor (T_text,).
      feats (Tensor): Feature tensor (T_feats, aux_channels).
      label (Optional[Dict]): key is "lab" or "score";
          value (LongTensor): Batch of padded label ids (B, Tmax).
      melody (Optional[Dict]): key is "lab" or "score";
          value (LongTensor): Batch of padded melody (B, Tmax).
      duration (Optional[Dict]): key is "lab", "score_phn" or "score_syb";
          value (LongTensor): Batch of padded duration (B, Tmax).
      pitch (FloatTensor): Batch of padded f0 (B, Tmax).
      slur (LongTensor): Batch of padded slur (B, Tmax).
      sids (Tensor): Speaker index tensor (1,).
      spembs (Optional[Tensor]): Speaker embedding tensor (spk_embed_dim,).
      lids (Tensor): Language index tensor (1,).
      noise_scale (float): Noise scale value for flow.
      noise_scale_dur (float): Noise scale value for duration predictor.
      alpha (float): Alpha parameter to control the speed of generated singing.
      max_len (Optional[int]): Maximum length.
      use_teacher_forcing (bool): Whether to use teacher forcing.
  
  Returns:
      Dict[str, Tensor]:
          * wav (Tensor): Generated waveform tensor (T_wav,).
          * feat_gan (Tensor): Generated feature tensor (T_text, C).
docstr_tok: ["Run","inference",".","Args",":","text","(","Tensor",")",":","Input","text","index","tensor","(","T_text",",",")",".","feats","(","Tensor",")",":","Feature","tensor","(","T_feats",",","aux_channels",")",".","label","(","Optional","[","Dict","]",")",":","key","is","``","lab","''","or","``","score","''",";","value","(","LongTensor",")",":","Batch","of","padded","label","ids","(","B",",","Tmax",")",".","melody","(","Optional","[","Dict","]",")",":","key","is","``","lab","''","or","``","score","''",";","value","(","LongTensor",")",":","Batch","of","padded","melody","(","B",",","Tmax",")",".","duration","(","Optional","[","Dict","]",")",":","key","is","``","lab","''",",","``","score_phn","''","or","``","score_syb","''",";","value","(","LongTensor",")",":","Batch","of","padded","duration","(","B",",","Tmax",")",".","pitch","(","FloatTensor",")",":","Batch","of","padded","f0","(","B",",","Tmax",")",".","slur","(","LongTensor",")",":","Batch","of","padded","slur","(","B",",","Tmax",")",".","sids","(","Tensor",")",":","Speaker","index","tensor","(","1",",",")",".","spembs","(","Optional","[","Tensor","]",")",":","Speaker","embedding","tensor","(","spk_embed_dim",",",")",".","lids","(","Tensor",")",":","Language","index","tensor","(","1",",",")",".","noise_scale","(","float",")",":","Noise","scale","value","for","flow",".","noise_scale_dur","(","float",")",":","Noise","scale","value","for","duration","predictor",".","alpha","(","float",")",":","Alpha","parameter","to","control","the","speed","of","generated","singing",".","max_len","(","Optional","[","int","]",")",":","Maximum","length",".","use_teacher_forcing","(","bool",")",":","Whether","to","use","teacher","forcing",".","Returns",":","Dict","[","str",",","Tensor","]",":","*","wav","(","Tensor",")",":","Generated","waveform","tensor","(","T_wav",",",")",".","*","feat_gan","(","Tensor",")",":","Generated","feature","tensor","(","T_text",",","C",")","."]
code: def inference(
      self,
      text: torch.Tensor,
      feats: Optional[torch.Tensor] = None,
      label: Optional[Dict[str, torch.Tensor]] = None,
      melody: Optional[Dict[str, torch.Tensor]] = None,
      pitch: Optional[torch.Tensor] = None,
      duration: Optional[Dict[str, torch.Tensor]] = None,
      slur: Optional[Dict[str, torch.Tensor]] = None,
      spembs: Optional[torch.Tensor] = None,
      sids: Optional[torch.Tensor] = None,
      lids: Optional[torch.Tensor] = None,
      noise_scale: float = 0.667,
      noise_scale_dur: float = 0.8,
      alpha: float = 1.0,
      max_len: Optional[int] = None,
      use_teacher_forcing: bool = False,
  ) -> Dict[str, torch.Tensor]:
      """Run inference.
  
      Args:
          text (Tensor): Input text index tensor (T_text,).
          feats (Tensor): Feature tensor (T_feats, aux_channels).
          label (Optional[Dict]): key is "lab" or "score";
              value (LongTensor): Batch of padded label ids (B, Tmax).
          melody (Optional[Dict]): key is "lab" or "score";
              value (LongTensor): Batch of padded melody (B, Tmax).
          duration (Optional[Dict]): key is "lab", "score_phn" or "score_syb";
              value (LongTensor): Batch of padded duration (B, Tmax).
          pitch (FloatTensor): Batch of padded f0 (B, Tmax).
          slur (LongTensor): Batch of padded slur (B, Tmax).
          sids (Tensor): Speaker index tensor (1,).
          spembs (Optional[Tensor]): Speaker embedding tensor (spk_embed_dim,).
          lids (Tensor): Language index tensor (1,).
          noise_scale (float): Noise scale value for flow.
          noise_scale_dur (float): Noise scale value for duration predictor.
          alpha (float): Alpha parameter to control the speed of generated singing.
          max_len (Optional[int]): Maximum length.
          use_teacher_forcing (bool): Whether to use teacher forcing.
  
      Returns:
          Dict[str, Tensor]:
              * wav (Tensor): Generated waveform tensor (T_wav,).
              * feat_gan (Tensor): Generated feature tensor (T_text, C).
  
      """
      output_dict = self.generator["score2mel"].inference(
          text=text,
          feats=feats,
          label=label,
          melody=melody,
          duration=duration,
          pitch=pitch,
          sids=sids,
          spembs=spembs,
          lids=lids,
          joint_training=True,
      )
      wav = self.generator["vocoder"].inference(output_dict["feat_gen"])
      if self.use_pqmf:
          wav = self.pqmf.synthesis(wav.unsqueeze(0).transpose(1, 2))
          wav = wav.squeeze(0).transpose(0, 1)
      output_dict.update(wav=wav)
  
      return output_dict
  
imports: from typing import Any, Dict, Optional
  import torch
  from typeguard import check_argument_types
  from espnet2.gan_svs.abs_gan_svs import AbsGANSVS
  from espnet2.gan_tts.hifigan import HiFiGANGenerator, HiFiGANMultiPeriodDiscriminator, HiFiGANMultiScaleDiscriminator, HiFiGANMultiScaleMultiPeriodDiscriminator, HiFiGANPeriodDiscriminator, HiFiGANScaleDiscriminator
  from espnet2.gan_tts.hifigan.loss import DiscriminatorAdversarialLoss, FeatureMatchLoss, GeneratorAdversarialLoss, MelSpectrogramLoss
  from espnet2.gan_tts.melgan import MelGANGenerator, MelGANMultiScaleDiscriminator
  from espnet2.gan_tts.melgan.pqmf import PQMF
  from espnet2.gan_tts.parallel_wavegan import ParallelWaveGANDiscriminator, ParallelWaveGANGenerator
  from espnet2.gan_tts.style_melgan import StyleMelGANDiscriminator, StyleMelGANGenerator
  from espnet2.gan_tts.utils import get_random_segments, get_segments
  from espnet2.svs.naive_rnn.naive_rnn_dp import NaiveRNNDP
  from espnet2.svs.xiaoice.XiaoiceSing import XiaoiceSing
  from espnet2.torch_utils.device_funcs import force_gatherable
label_desc: Use image node_id 7 for calling the JointScore2Wav obj's underlying member method code with example usage: obj.inference(text, feats, label, melody, pitch, duration, slur, spembs, sids, lids, noise_scale, noise_scale_dur, alpha, max_len, use_teacher_forcing) and returns: output_dict