class_docstr: Plot attention reporter.
  
  Args:
      att_vis_fn (espnet.nets.*_backend.e2e_asr.calculate_all_attentions):
          Function of attention visualization.
      data (list[tuple(str, dict[str, dict[str, Any]])]): List json utt key items.
      outdir (str): Directory to save figures.
      converter (espnet.asr.*_backend.asr.CustomConverter):
          CustomConverter object. Function to convert data.
      device (torch.device): The destination device to send tensor.
      reverse (bool): If True, input and output length are reversed.
class_docstr_tok: ["Plot","attention","reporter",".","Args",":","att_vis_fn","(","espnet.nets",".","*","_backend.e2e_asr.calculate_all_attentions",")",":","Function","of","attention","visualization",".","data","(","list","[","tuple","(","str",",","dict","[","str",",","dict","[","str",",","Any","]","]",")","]",")",":","List","json","utt","key","items",".","outdir","(","str",")",":","Directory","to","save","figures",".","converter","(","espnet.asr",".","*","_backend.asr.CustomConverter",")",":","CustomConverter","object",".","Function","to","convert","data",".","device","(","torch.device",")",":","The","destination","device","to","send","tensor",".","reverse","(","bool",")",":","If","True",",","input","and","output","length","are","reversed","."]
docstr: Visualize attention weights matrix.
  
  Args:
      att_w(Tensor): Attention weight matrix.
  
  Returns:
      matplotlib.pyplot: pyplot object with attention matrix image.
docstr_tok: ["Visualize","attention","weights","matrix",".","Args",":","att_w","(","Tensor",")",":","Attention","weight","matrix",".","Returns",":","matplotlib.pyplot",":","pyplot","object","with","attention","matrix","image","."]
code: def draw_attention_plot(self, att_w):
      """Visualize attention weights matrix.
  
      Args:
          att_w(Tensor): Attention weight matrix.
  
      Returns:
          matplotlib.pyplot: pyplot object with attention matrix image.
  
      """
      import matplotlib
  
      matplotlib.use("Agg")
      import matplotlib.pyplot as plt
  
      if len(att_w.shape) == 3:
          for h, aw in enumerate(att_w, 1):
              plt.subplot(1, len(att_w), h)
              plt.imshow(aw, aspect="auto")
              plt.xlabel("Encoder Index")
              plt.ylabel("Decoder Index")
      else:
          plt.imshow(att_w, aspect="auto")
          plt.xlabel("Encoder Index")
          plt.ylabel("Decoder Index")
      plt.tight_layout()
      return plt
  
file_path: espnet/espnet/asr/asr_mix_utils.py
imports: import copy
  import logging
  import os
  from chainer.training import extension
  from espnet.asr.asr_utils import parse_hypothesis
label_desc: Use image node_id 6 for calling the PlotAttentionReport obj's underlying member method code with example usage: obj.draw_attention_plot(att_w) and returns: plt