code: def _get_shape(x, out_type=tf.int32):
      # Return the shape of a Tensor or a SparseTensor as an np.array if its shape
      # is known statically. Otherwise return a Tensor representing the shape.
      if x.shape.is_fully_defined():
          return np.array(
              x.shape.as_list(), dtype=out_type.as_numpy_dtype
          )
      return tf.shape(x, out_type=out_type)
  
file_path: probability/tensorflow_probability/python/optimizer/proximal_hessian_sparse.py
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math.generic import soft_threshold
  from tensorflow_probability.python.math.linalg import sparse_or_dense_matvecmul
label_desc: Use image node_id 6 for calling a global function with example usage: _get_shape(x, out_type) and returns: tf, np