'Args:
name (str):
val (np.ndarray): 2D, 3D (HWC) or 4D (NHWC) numpy array of images
in range [0,255].  If channel is 3, assumed to be RGB.'

def put_image(self, name, val):

    assert isinstance(val, np.ndarray)
    arr = image_to_nhwc(val)
    self._dispatch((lambda m: m.put_image(name, arr)))
    s = create_image_summary(name, arr)
    self._dispatch((lambda m: m.put_summary(s)))
