class_docstr: Tests functions related to composite tensors.
class_docstr_tok: ["Tests","functions","related","to","composite","tensors","."]
code: def testSliceTo(self):
      to_1 = composite.slice_to(self._x, axis=1, end=1)
      to_n1 = composite.slice_to(self._x, axis=1, end=-1)
      x, to_1, to_n1 = self.evaluate((self._x, to_1, to_n1))
      self.assertAllEqual(to_1, x[:, :1, :])
      self.assertAllEqual(to_n1, x[:, :-1, :])
  
      s_from_1 = _to_dense(composite.slice_to(self._sx, axis=1, end=1))
      s_from_n1 = _to_dense(
          composite.slice_to(self._sx, axis=1, end=-1)
      )
      sx = _to_dense(self._sx)
      sx, s_from_1, s_from_n1 = self.evaluate((sx, s_from_1, s_from_n1))
      self.assertAllEqual(s_from_1, sx[:, :1, :])
      self.assertAllEqual(s_from_n1, sx[:, :-1, :])
  
file_path: agents/tf_agents/utils/composite_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.utils import composite
label_desc: Use image node_id 3 for calling the CompositeTest obj's underlying member method code with example usage: obj.testSliceTo() without return types