code: def benchmarkVeryLarge2DFloatSparseTensor(self):
      np.random.seed(127)
      num_elements = 10000
      batch_size = 64
      indices_batch = np.random.randint(
          batch_size, size=num_elements, dtype=np.int64
      )
      indices_value = np.arange(num_elements, dtype=np.int64)
      indices = np.asarray(
          sorted(zip(indices_batch, indices_value)), dtype=np.int64
      )
      values = ["feature_value_for_embedding_lookup"] * num_elements
      shape = np.asarray([batch_size, num_elements], dtype=np.int64)
      with session.Session(config=benchmark.benchmark_config()) as sess:
          with ops.device("/cpu:0"):
              indices = variables.Variable(indices)
              values = variables.Variable(values)
              shape = variables.Variable(shape)
              st = sparse_tensor_lib.SparseTensor(
                  indices, values, shape
              )
  
              st_handles = add_many_sparse_to_tensors_map(st)
              st_roundtrip = take_many_sparse_from_tensors_map(
                  sparse_map_op=st_handles.op, sparse_handles=st_handles
              )
              st_roundtrip_op = st_roundtrip.values.op
  
              st_serialized = sparse_ops.serialize_many_sparse(st)
              st_deserialized = sparse_ops.deserialize_many_sparse(
                  st_serialized, dtype=values.dtype
              )
              st_deserialized_op = st_deserialized.values.op
  
              self.evaluate(variables.global_variables_initializer())
  
              st_roundtrip_values = self.evaluate(st_roundtrip)
              st_deserialized_values = self.evaluate(st_deserialized)
              np.testing.assert_equal(
                  st_roundtrip_values.values,
                  st_deserialized_values.values,
              )
              np.testing.assert_equal(
                  st_roundtrip_values.indices,
                  st_deserialized_values.indices,
              )
              np.testing.assert_equal(
                  st_roundtrip_values.dense_shape,
                  st_deserialized_values.dense_shape,
              )
  
              self.run_op_benchmark(
                  sess,
                  st_roundtrip_op,
                  min_iters=2000,
                  name="benchmark_very_large_2d_float_st_tensor_maps",
              )
              self.run_op_benchmark(
                  sess,
                  st_deserialized_op,
                  min_iters=2000,
                  name="benchmark_very_large_2d_float_st_serialization",
              )
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the BenchmarkSparseTensorsMapVsSerialization obj's underlying member method code with example usage: obj.benchmarkVeryLarge2DFloatSparseTensor() without return types