class_docstr: Dump some tensors to a file.
  Every step this callback fetches tensors and write them to a npz file
  under ``logger.get_logger_dir``.
  The dump can be loaded by ``dict(np.load(filename).items())``.
class_docstr_tok: ["Dump","some","tensors","to","a","file",".","Every","step","this","callback","fetches","tensors","and","write","them","to","a","npz","file","under","``","logger.get_logger_dir","``",".","The","dump","can","be","loaded","by","``","dict","(","np.load","(","filename",")",".items","(",")",")","``","."]
docstr: Args:
      names (list[str]): names of tensors
docstr_tok: ["Args",":","names","(","list","[","str","]",")",":","names","of","tensors"]
code: def __init__(self, names):
      """
      Args:
          names (list[str]): names of tensors
      """
      assert isinstance(names, (list, tuple)), names
      self._names = names
      dir = logger.get_logger_dir()
  
      def fn(*args):
          dic = {}
          for name, val in zip(self._names, args):
              dic[name] = val
          fname = os.path.join(
              dir, "DumpTensor-{}.npz".format(self.global_step)
          )
          np.savez(fname, **dic)
  
      super(DumpTensors, self).__init__(names, fn)
  
imports: import numpy
  import os
  from ..compat import tfv1
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from .base import Callback
label_desc: Use image node_id 1 to create a new DumpTensors object from inherited base classes: ProcessTensors with example: obj = DumpTensors(names)