code: def size(input, name=None, out_type=None):
      # pylint: disable=redefined-builtin
      """Returns the size of a tensor."""
      if out_type is None:
          if flags.config().tf_shape_default_int64.value():
              out_type = dtypes.int64
          else:
              out_type = dtypes.int32
      with ops.name_scope(name, "size", [input]) as name:
          if not input.row_partitions:
              if input.nrows() is not None:
                  return math_ops.cast(
                      input.nrows(), out_type
                  )  # vector.
              else:
                  return math_ops.cast(1, out_type)  # scalar.
          # 2D and up.
          nvals = input.row_partitions[-1].nvals()
          if nvals is None or out_type is None:
              return nvals
          return math_ops.cast(nvals, dtype=out_type)
  
imports: from typing import Sequence
  from tensorflow.core.config import flags
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import dynamic_ragged_shape
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.row_partition import RowPartition
  from tensorflow.python.ops.structured.structured_tensor import StructuredTensor
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
label_desc: Use image node_id 9 for calling a global function with example usage: size(input, name, out_type) and returns: math_ops, nvals, math_ops, math_ops