code: def plot_alignment(
      alignment,
      info=None,
      fig_size=(16, 10),
      title=None,
      output_fig=False,
  ):
      if isinstance(alignment, torch.Tensor):
          alignment_ = alignment.detach().cpu().numpy().squeeze()
      else:
          alignment_ = alignment
      alignment_ = (
          alignment_.astype(np.float32)
          if alignment_.dtype == np.float16
          else alignment_
      )
      fig, ax = plt.subplots(figsize=fig_size)
      im = ax.imshow(
          alignment_.T,
          aspect="auto",
          origin="lower",
          interpolation="none",
      )
      fig.colorbar(im, ax=ax)
      xlabel = "Decoder timestep"
      if info is not None:
          xlabel += "\n\n" + info
      plt.xlabel(xlabel)
      plt.ylabel("Encoder timestep")
      # plt.yticks(range(len(text)), list(text))
      plt.tight_layout()
      if title is not None:
          plt.title(title)
      if not output_fig:
          plt.close()
      return fig
  
file_path: TTS/TTS/tts/utils/visual.py
imports: import librosa
  import matplotlib
  import numpy
  import torch
  import matplotlib.pyplot
  from TTS.tts.utils.text import phoneme_to_sequence, sequence_to_phoneme
label_desc: Use image node_id 1 for calling a global function with example usage: plot_alignment(alignment, info, fig_size, title, output_fig) and returns: fig