docstr: Helper function for testing StructuredTensor.__getitem__.
  
  Checks that calling `struct.__getitem__(slice_spec) returns the expected
  value.  Checks three different configurations for each slice spec:
  
    * Call __getitem__ with the slice spec as-is (with int values)
    * Call __getitem__ with int values in the slice spec wrapped in
      `tf.constant()`.
    * Call __getitem__ with int values in the slice spec wrapped in
      `tf.compat.v1.placeholder()` (so value is not known at graph
      construction time).
  
  Args:
    struct: The StructuredTensor to test.
    slice_spec: The slice spec.
    expected: The expected value of struct.__getitem__(slice_spec), as a
      python list.
docstr_tok: ["Helper","function","for","testing","StructuredTensor.__getitem__",".","Checks","that","calling","`","struct.__getitem__","(","slice_spec",")","returns","the","expected","value",".","Checks","three","different","configurations","for","each","slice","spec",":","*","Call","__getitem__","with","the","slice","spec","as-is","(","with","int","values",")","*","Call","__getitem__","with","int","values","in","the","slice","spec","wrapped","in","`","tf.constant","(",")","`",".","*","Call","__getitem__","with","int","values","in","the","slice","spec","wrapped","in","`","tf.compat.v1.placeholder","(",")","`","(","so","value","is","not","known","at","graph","construction","time",")",".","Args",":","struct",":","The","StructuredTensor","to","test",".","slice_spec",":","The","slice","spec",".","expected",":","The","expected","value","of","struct.__getitem__","(","slice_spec",")",",","as","a","python","list","."]
code: def _TestGetItem(self, struct, slice_spec, expected):
      """Helper function for testing StructuredTensor.__getitem__.
  
      Checks that calling `struct.__getitem__(slice_spec) returns the expected
      value.  Checks three different configurations for each slice spec:
  
        * Call __getitem__ with the slice spec as-is (with int values)
        * Call __getitem__ with int values in the slice spec wrapped in
          `tf.constant()`.
        * Call __getitem__ with int values in the slice spec wrapped in
          `tf.compat.v1.placeholder()` (so value is not known at graph
          construction time).
  
      Args:
        struct: The StructuredTensor to test.
        slice_spec: The slice spec.
        expected: The expected value of struct.__getitem__(slice_spec), as a
          python list.
      """
      tensor_slice_spec1 = _make_tensor_slice_spec(slice_spec, True)
      tensor_slice_spec2 = _make_tensor_slice_spec(slice_spec, False)
      value1 = struct.__getitem__(slice_spec)
      value2 = struct.__getitem__(tensor_slice_spec1)
      value3 = struct.__getitem__(tensor_slice_spec2)
      self.assertAllEqual(
          value1, expected, "slice_spec=%s" % (slice_spec,)
      )
      self.assertAllEqual(
          value2, expected, "slice_spec=%s" % (slice_spec,)
      )
      self.assertAllEqual(
          value3, expected, "slice_spec=%s" % (slice_spec,)
      )
  
imports: from absl.testing import parameterized
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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.structured import structured_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the StructuredTensorSliceTest obj's underlying member method code with example usage: obj._TestGetItem(struct, slice_spec, expected) without return types