docstr: Confirm that supported types are correctly detected and handled.
docstr_tok: ["Confirm","that","supported","types","are","correctly","detected","and","handled","."]
code: def testSupportedTypes(self):
      """Confirm that supported types are correctly detected and handled."""
  
      a = constant_op.constant(1)
      b = constant_op.constant(1)
      c = math_ops.add(a, b)
  
      def sub(t):
          return t
  
      # Tuples.
      subscribed = subscribe.subscribe(
          (a, b), lambda t: script_ops.py_func(sub, [t], [t.dtype])
      )
      self.assertIsInstance(subscribed, tuple)
      self._ExpectSubscribedIdentities(subscribed)
  
      # Lists.
      subscribed = subscribe.subscribe(
          [a, b], lambda t: script_ops.py_func(sub, [t], [t.dtype])
      )
      self.assertIsInstance(subscribed, list)
      self._ExpectSubscribedIdentities(subscribed)
  
      # Dictionaries.
      subscribed = subscribe.subscribe(
          {"first": a, "second": b},
          lambda t: script_ops.py_func(sub, [t], [t.dtype]),
      )
      self.assertIsInstance(subscribed, dict)
      self._ExpectSubscribedIdentities(subscribed.values())
  
      # Namedtuples.
      # pylint: disable=invalid-name
      TensorPair = collections.namedtuple(
          "TensorPair", ["first", "second"]
      )
      # pylint: enable=invalid-name
      pair = TensorPair(a, b)
      subscribed = subscribe.subscribe(
          pair, lambda t: script_ops.py_func(sub, [t], [t.dtype])
      )
      self.assertIsInstance(subscribed, TensorPair)
      self._ExpectSubscribedIdentities(subscribed)
  
      # Expect an exception to be raised for unsupported types.
      with self.assertRaisesRegex(TypeError, "has invalid type"):
          subscribe.subscribe(
              c.name, lambda t: script_ops.py_func(sub, [t], [t.dtype])
          )
  
imports: import collections
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import subscribe
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 3 for calling the SubscribeTest obj's underlying member method code with example usage: obj.testSupportedTypes() and returns: t