code: def is_image(tensor):
      """
      Check if a tensor has the shape of
      a valid image for tensorboard logging.
      Valid image: RGB, RGBD, GrayScale
  
      :param tensor: (np.ndarray or tf.placeholder)
      :return: (bool)
      """
  
      return len(tensor.shape) == 3 and tensor.shape[-1] in [1, 3, 4]
  
imports: import os
  import collections
  import functools
  import multiprocessing
  from typing import Set
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: is_image(tensor) and returns: unknown