class_docstr: Encode an image to PNG.
  
  This function is thread-safe, and has high performance when run in
  parallel. See `encode_png_benchmark.py` for details.
  
  Arguments:
    image: A numpy array of shape `[height, width, channels]`, where
      `channels` is 1, 3, or 4, and of dtype uint8.
  
  Returns:
    A bytestring with PNG-encoded data.
code: def run(self, image):  # pylint: disable=arguments-differ
      if not isinstance(image, np.ndarray):
          raise ValueError("'image' must be a numpy array: %r" % image)
      if image.dtype != np.uint8:
          raise ValueError(
              "'image' dtype must be uint8, but is %r" % image.dtype
          )
      return self._encode_op.eval(
          feed_dict={self._image_placeholder: image}
      )
  
file_path: tensorboard/tensorboard/util/encoder.py
imports: import numpy
  from tensorboard.util import op_evaluator
label_desc: Use image node_id 3 for calling the _TensorFlowPngEncoder obj's underlying member method code with example usage: obj.run(image) and returns: self