code: def to_4D_image(image):
      """Convert 2/3/4D image to 4D image.
  
      Args:
        image: 2/3/4D `Tensor`.
  
      Returns:
        4D `Tensor` with the same type.
      """
      with tf.control_dependencies(
          [
              tf.debugging.assert_rank_in(
                  image,
                  [2, 3, 4],
                  message="`image` must be 2/3/4D tensor",
              )
          ]
      ):
          ndims = image.get_shape().ndims
          if ndims is None:
              return _dynamic_to_4D_image(image)
          elif ndims == 2:
              return image[None, :, :, None]
          elif ndims == 3:
              return image[None, :, :, :]
          else:
              return image
  
file_path: addons/tensorflow_addons/image/utils.py
imports: import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: to_4D_image(image) and returns: _dynamic_to_4D_image, image, image, image