code: def testLegacyAccessFeaturesDict(self):
      with tf.compat.v1.Session() as sess:
          sparse = tf.SparseTensor(
              indices=[[0, 0], [1, 1]],
              values=["apple", "banana"],
              dense_shape=[2, 2],
          )
          dense = tf.constant([1.0, 2.0])
          dense_single = tf.constant([7.0])
          dense_multidim = tf.constant([[1.0, 2.0], [3.0, 4.0]])
          squeeze_needed = tf.constant([[2.0]])
          (
              sparse_value,
              dense_value,
              dense_single_value,
              dense_multidim_value,
              squeeze_needed_value,
          ) = sess.run(
              fetches=[
                  sparse,
                  dense,
                  dense_single,
                  dense_multidim,
                  squeeze_needed,
              ]
          )
          features_dict = {
              "sparse": {encoding.NODE_SUFFIX: sparse_value},
              "dense": {encoding.NODE_SUFFIX: dense_value},
              "dense_single": {
                  encoding.NODE_SUFFIX: dense_single_value
              },
              "squeeze_needed": {
                  encoding.NODE_SUFFIX: squeeze_needed_value
              },
              "dense_multidim": {
                  encoding.NODE_SUFFIX: dense_multidim_value
              },
          }
          accessor = slice_accessor.SliceAccessor([features_dict])
          self.assertEqual(
              [b"apple", b"banana"], accessor.get("sparse")
          )
          self.assertEqual([1.0, 2.0], accessor.get("dense"))
          self.assertEqual([7.0], accessor.get("dense_single"))
          self.assertEqual(
              [1.0, 2.0, 3.0, 4.0], accessor.get("dense_multidim")
          )
          self.assertEqual([2.0], accessor.get("squeeze_needed"))
  
file_path: model-analysis/tensorflow_model_analysis/slicer/slice_accessor_test.py
imports: from absl.testing import parameterized
  import numpy
  import pyarrow
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.slicer import slice_accessor
label_desc: Use image node_id 3 for calling the SliceAccessorTest obj's underlying member method code with example usage: obj.testLegacyAccessFeaturesDict() without return types