class_docstr: Base class shared by Tacotron and Tacotron2
docstr: Double Decoder Consistency
docstr_tok: ["Double","Decoder","Consistency"]
code: def _coarse_decoder_pass(
      self, mel_specs, encoder_outputs, alignments, input_mask
  ):
      """Double Decoder Consistency"""
      T = mel_specs.shape[1]
      if T % self.coarse_decoder.r > 0:
          padding_size = self.coarse_decoder.r - (
              T % self.coarse_decoder.r
          )
          mel_specs = torch.nn.functional.pad(
              mel_specs, (0, 0, 0, padding_size, 0, 0)
          )
      (
          decoder_outputs_backward,
          alignments_backward,
          _,
      ) = self.coarse_decoder(
          encoder_outputs.detach(), mel_specs, input_mask
      )
      # scale_factor = self.decoder.r_init / self.decoder.r
      alignments_backward = torch.nn.functional.interpolate(
          alignments_backward.transpose(1, 2),
          size=alignments.shape[1],
          mode="nearest",
      ).transpose(1, 2)
      decoder_outputs_backward = decoder_outputs_backward.transpose(
          1, 2
      )
      decoder_outputs_backward = decoder_outputs_backward[:, :T, :]
      return decoder_outputs_backward, alignments_backward
  
imports: import copy
  from abc import abstractmethod
  from typing import Dict, Tuple
  import torch
  from coqpit import Coqpit
  from torch import nn
  from TTS.tts.layers.losses import TacotronLoss
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.tts.utils.helpers import sequence_mask
  from TTS.tts.utils.speakers import SpeakerManager
  from TTS.tts.utils.synthesis import synthesis
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.tts.utils.visual import plot_alignment, plot_spectrogram
  from TTS.utils.generic_utils import format_aux_input
  from TTS.utils.io import load_fsspec
  from TTS.utils.training import gradual_training_scheduler
label_desc: Use image node_id 14 for calling the BaseTacotron obj's underlying member method code with example usage: obj._coarse_decoder_pass(mel_specs, encoder_outputs, alignments, input_mask) and returns: decoder_outputs_backward,  alignments_backward