code: def SimpleSparseTensorFrom(x):
      """Create a very simple SparseTensor with dimensions (batch, time).
  
      Args:
        x: a list of lists of type int
  
      Returns:
        x_ix and x_val, the indices and values of the SparseTensor<2>.
      """
      x_ix = []
      x_val = []
      for batch_i, batch in enumerate(x):
          for time, val in enumerate(batch):
              x_ix.append([batch_i, time])
              x_val.append(val)
      x_shape = [len(x), np.asarray(x_ix).max(0)[1] + 1]
      x_ix = constant_op.constant(x_ix, dtypes.int64)
      x_val = constant_op.constant(x_val, dtypes.int32)
      x_shape = constant_op.constant(x_shape, dtypes.int64)
  
      return sparse_tensor.SparseTensor(x_ix, x_val, x_shape)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import ctc_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: SimpleSparseTensorFrom(x) and returns: sparse_tensor