code: def testFromToCompositeTensor(self):
      tensors = [ops.convert_to_tensor(0.1), ops.convert_to_tensor(0.2)]
  
      flattened = nest.flatten(tensors, expand_composites=True)
      # Each ndarray contains only one tensor, so the flattened output should be
      # just 2 tensors in a list.
      self.assertLen(flattened, 2)
      self.assertIsInstance(flattened[0], tensor.Tensor)
      self.assertIsInstance(flattened[1], tensor.Tensor)
  
      repacked = nest.pack_sequence_as(
          tensors, flattened, expand_composites=True
      )
      self.assertLen(repacked, 2)
      self.assertIsInstance(repacked[0], np_arrays.ndarray)
      self.assertIsInstance(repacked[1], np_arrays.ndarray)
  
      self.assertAllClose(tensors, repacked)
  
imports: import numpy
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.numpy_ops import np_arrays
  from tensorflow.python.ops.numpy_ops import np_math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import nest
label_desc: Use image node_id 26 for calling the ArrayTest obj's underlying member method code with example usage: obj.testFromToCompositeTensor() without return types