class_docstr: Track peak memory used on each GPU device every epoch, by :mod:`tf.contrib.memory_stats`.
  The peak memory comes from the ``MaxBytesInUse`` op, which is the peak memory used
  in recent ``session.run`` calls.
  See https://github.com/tensorflow/tensorflow/pull/13107.
class_docstr_tok: ["Track","peak","memory","used","on","each","GPU","device","every","epoch",",","by",":","mod",":","`","tf.contrib.memory_stats","`",".","The","peak","memory","comes","from","the","``","MaxBytesInUse","``","op",",","which","is","the","peak","memory","used","in","recent","``","session.run","``","calls",".","See","https",":","\/\/github.com\/tensorflow\/tensorflow\/pull\/13107","."]
docstr: Args:
      devices([int] or [str]): list of GPU devices to track memory on.
code: def __init__(self, devices=(0,)):
      """
      Args:
          devices([int] or [str]): list of GPU devices to track memory on.
      """
      assert isinstance(devices, (list, tuple)), devices
      devices = [
          "/gpu:{}".format(x) if isinstance(x, int) else x
          for x in devices
      ]
      self._devices = devices
      self._disabled = False
  
imports: import multiprocessing
  import numpy
  import os
  import time
  import tensorflow
  from six.moves import map, queue
  import psutil
  from ..tfutils.common import gpu_available_in_session
  from ..utils import logger
  from ..utils.timer import Timer
  from ..utils.concurrency import ensure_proc_terminate, start_proc_mask_signal
  from ..utils.gpu import get_num_gpu
  from ..utils.nvml import NVMLContext
  from .base import Callback
label_desc: Use image node_id 1 to create a new GPUMemoryTracker object from inherited base classes: Callback with example: obj = GPUMemoryTracker(devices)