code: def testFromSparseTensor(self):
      st_0 = sparse_tensor.SparseTensorValue(
          indices=np.array([[0]]),
          values=np.array([0], dtype=np.int64),
          dense_shape=np.array([1]),
      )
      st_1 = sparse_tensor.SparseTensorValue(
          indices=np.array([[0, 0], [1, 1]]),
          values=np.array([-1.0, 1.0], dtype=np.float32),
          dense_shape=np.array([2, 2]),
      )
      opt = optional_ops.Optional.from_value((st_0, st_1))
      self.assertTrue(self.evaluate(opt.has_value()))
      val_0, val_1 = opt.get_value()
      for expected, actual in [(st_0, val_0), (st_1, val_1)]:
          self.assertAllEqual(
              expected.indices, self.evaluate(actual.indices)
          )
          self.assertAllEqual(
              expected.values, self.evaluate(actual.values)
          )
          self.assertAllEqual(
              expected.dense_shape, self.evaluate(actual.dense_shape)
          )
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import iterator_ops
  from tensorflow.python.data.ops import optional_ops
  from tensorflow.python.data.util import structure
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_shape
  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 math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the OptionalTest obj's underlying member method code with example usage: obj.testFromSparseTensor() without return types