code: def _size(
      input, out_type=_get_size_out_type(), name=None
  ):  # pylint: disable=redefined-builtin,missing-docstring
      if out_type is None:
          # Only Tensorflow has a flag to control the default ouput of tf.size and
          # uses out_type=None in the signature. For Jax and numpy, out_type is never
          # None.
          out_type = tf.size([]).dtype
      if not hasattr(input, "shape"):
          x = np.array(input)
          input = (
              tf.convert_to_tensor(input)
              if x.dtype == np.object_
              else x
          )
      n = tensorshape_util.num_elements(tf.TensorShape(input.shape))
      if n is None:
          return tf.size(input, out_type=out_type, name=name)
      return np.array(n).astype(_numpy_dtype(out_type))
  
imports: import decorator
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal.backend import numpy
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_case
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 20 for calling a global function with example usage: _size(input, out_type, name) and returns: np, tf