code: def set_shape(tensor, shape):
      """Updates the shape of this tensor.
  
      This method can be called multiple times, and will merge the given
      `shape` with the current shape of this tensor. It can be used to
      provide additional information about the shape of this tensor that
      cannot be inferred from the graph alone. For example, this can be used
      to provide additional information about the shapes of images:
  
      ```python
      _, image_data = tf.TFRecordReader(...).read(...)
      image = tf.image.decode_png(image_data, channels=3)
  
      # The height and width dimensions of `image` are data dependent, and
      # cannot be computed without executing the op.
      print(image.shape)
      ==> TensorShape([Dimension(None), Dimension(None), Dimension(3)])
  
      # We know that each image in this dataset is 28 x 28 pixels.
      image.set_shape([28, 28, 3])
      print(image.shape)
      ==> TensorShape([Dimension(28), Dimension(28), Dimension(3)])
      ```
  
      NOTE: This shape is not enforced at runtime. Setting incorrect shapes can
      result in inconsistencies between the statically-known graph and the runtime
      value of tensors. For runtime validation of the shape, use `tf.ensure_shape`
      instead.
  
      Args:
        tensor: `Tensor` which will have its static shape set.
        shape: A `TensorShape` representing the shape of this tensor, a
        `TensorShapeProto`, a list, a tuple, or None.
  
      Raises:
        ValueError: If `shape` is not compatible with the current shape of
          this tensor.
      """
      if hasattr(tensor, "set_shape"):
          tensor.set_shape(shape)
  
file_path: probability/tensorflow_probability/python/internal/tensorshape_util.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
label_desc: Use image node_id 13 for calling a global function with example usage: set_shape(tensor, shape) without return types