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 initialize_graph(self):
      # TODO(nickfelt): remove on-demand imports once dep situation is fixed.
      import tensorflow.compat.v1 as tf
  
      self._image_placeholder = tf.placeholder(
          dtype=tf.uint8, name="image_to_encode"
      )
      self._encode_op = tf.image.encode_png(self._image_placeholder)
  
file_path: tensorboard/tensorboard/util/encoder.py
imports: import numpy
  from tensorboard.util import op_evaluator
label_desc: Use image node_id 2 for calling the _TensorFlowPngEncoder obj's underlying member method code with example usage: obj.initialize_graph() without return types