code: def testAddN(self):
      devices = ["/cpu:0"]
      if test_util.is_gpu_available():
          devices.append("/gpu:0")
      for device in devices:
          with ops.device(device):
              # With value
              opt1 = optional_ops.Optional.from_value((1.0, 2.0))
              opt2 = optional_ops.Optional.from_value((3.0, 4.0))
  
              add_tensor = math_ops.add_n(
                  [opt1._variant_tensor, opt2._variant_tensor]
              )
              add_opt = optional_ops._OptionalImpl(
                  add_tensor, opt1.element_spec
              )
              self.assertAllEqual(
                  self.evaluate(add_opt.get_value()), (4.0, 6.0)
              )
  
              # Without value
              opt_none1 = optional_ops.Optional.empty(opt1.element_spec)
              opt_none2 = optional_ops.Optional.empty(opt2.element_spec)
              add_tensor = math_ops.add_n(
                  [opt_none1._variant_tensor, opt_none2._variant_tensor]
              )
              add_opt = optional_ops._OptionalImpl(
                  add_tensor, opt_none1.element_spec
              )
              self.assertFalse(self.evaluate(add_opt.has_value()))
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import iterator_ops
  from tensorflow.python.data.ops import optional_ops
  from tensorflow.python.data.util import structure
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  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 import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the OptionalTest obj's underlying member method code with example usage: obj.testAddN() without return types