code: def dims(x):
      """Returns a list of dimension sizes, or `None` if `rank` is unknown.
  
      For more details, see `help(tf.TensorShape.dims)`.
  
      Args:
        x: object representing a shape; convertible to `tf.TensorShape`.
  
      Returns:
        shape_as_list: list of sizes or `None` values representing each
          dimensions size if known. A size is `tf.Dimension` if input is a
          `tf.TensorShape` and an `int` otherwise.
      """
      if isinstance(x, tf.TensorShape):
          return x.dims
      r = tf.TensorShape(x).dims
      return (
          None if r is None else list(map(tf.compat.dimension_value, r))
      )
  
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 7 for calling a global function with example usage: dims(x) and returns: unknown, x