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: Plot and save imaged matrix of att_ws.
docstr_tok: ["Plot","and","save","imaged","matrix","of","att_ws","."]
code: def __call__(self, trainer):
      """Plot and save imaged matrix of att_ws."""
      att_ws_sd = self.get_attention_weights()
      for ns, att_ws in enumerate(att_ws_sd):
          for idx, att_w in enumerate(att_ws):
              filename = "%s/%s.ep.{.updater.epoch}.output%d.png" % (
                  self.outdir,
                  self.data[idx][0],
                  ns + 1,
              )
              att_w = self.get_attention_weight(idx, att_w, ns)
              self._plot_and_save_attention(
                  att_w, filename.format(trainer)
              )
  
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 2 for calling the PlotAttentionReport obj's underlying member method code with example usage: obj.__call__(trainer) without return types