code: def log_attentions(self, logger, step):
      def log_fig(plot, filename):
          import matplotlib
  
          matplotlib.use("Agg")
          import matplotlib.pyplot as plt
  
          logger.add_figure(os.path.basename(filename), plot, step)
          plt.clf()
  
      attn_dict, uttid_list = self.get_attention_weights()
      self.plotfn(
          self.data_dict,
          uttid_list,
          attn_dict,
          self.outdir,
          "",
          log_fig,
      )
  
file_path: espnet/espnet/nets/pytorch_backend/transformer/plot.py
imports: import logging
  import os
  import numpy
  from espnet.asr import asr_utils
label_desc: Use image node_id 4 for calling the PlotAttentionReport obj's underlying member method code with example usage: obj.log_attentions(logger, step) without return types