class_docstr: Defines inference for tasks where both the input and output sequences
  are plain text.
  
  Params:
    delimiter: Character by which tokens are delimited. Defaults to space.
    unk_replace: If true, enable unknown token replacement based on attention
      scores.
    unk_mapping: If `unk_replace` is true, this can be the path to a file
      defining a dictionary to improve UNK token replacement. Refer to the
      documentation for more details.
    dump_attention_dir: Save attention scores and plots to this directory.
    dump_attention_no_plot: If true, only save attention scores, not
      attention plots.
    dump_beams: Write beam search debugging information to this file.
class_docstr_tok: ["Defines","inference","for","tasks","where","both","the","input","and","output","sequences","are","plain","text",".","Params",":","delimiter",":","Character","by","which","tokens","are","delimited",".","Defaults","to","space",".","unk_replace",":","If","true",",","enable","unknown","token","replacement","based","on","attention","scores",".","unk_mapping",":","If","`","unk_replace","`","is","true",",","this","can","be","the","path","to","a","file","defining","a","dictionary","to","improve","UNK","token","replacement",".","Refer","to","the","documentation","for","more","details",".","dump_attention_dir",":","Save","attention","scores","and","plots","to","this","directory",".","dump_attention_no_plot",":","If","true",",","only","save","attention","scores",",","not","attention","plots",".","dump_beams",":","Write","beam","search","debugging","information","to","this","file","."]
code: def after_run(self, _run_context, run_values):
      fetches_batch = run_values.results
      for fetches in unbatch_dict(fetches_batch):
          # Convert to unicode
          fetches["predicted_tokens"] = np.char.decode(
              fetches["predicted_tokens"].astype("S"), "utf-8"
          )
          fetches["features.source_tokens"] = np.char.decode(
              fetches["features.source_tokens"].astype("S"), "utf-8"
          )
  
          if self.params["dump_plots"]:
              output_path = os.path.join(
                  self.params["output_dir"],
                  "{:05d}.png".format(self._idx),
              )
              _create_figure(fetches)
              plt.savefig(output_path)
              plt.close()
              tf.logging.info("Wrote %s", output_path)
              self._idx += 1
          self._attention_scores_accum.append(_get_scores(fetches))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import numpy
  from matplotlib import pyplot
  import tensorflow
  from tensorflow import gfile
  from seq2seq.tasks.decode_text import _get_prediction_length
  from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
label_desc: Use image node_id 5 for calling the DumpAttention obj's underlying member method code with example usage: obj.after_run(_run_context, run_values) without return types