code: def test_serialization_lifecycle(self):
      arch = _Architecture(
          "foo", "dummy_ensembler_name", replay_indices=[1, 2]
      )
      arch.add_subnetwork(0, "linear")
      arch.add_subnetwork(0, "dnn")
      arch.add_subnetwork(1, "dnn")
      self.assertEqual("foo", arch.ensemble_candidate_name)
      self.assertEqual("dummy_ensembler_name", arch.ensembler_name)
      self.assertEqual(
          ((0, ("linear", "dnn")), (1, ("dnn",))),
          arch.subnetworks_grouped_by_iteration,
      )
      iteration_number = 2
      global_step = 100
      serialized = arch.serialize(iteration_number, global_step)
      self.assertEqual(
          '{"ensemble_candidate_name": "foo", "ensembler_name": '
          '"dummy_ensembler_name", "global_step": 100, "iteration_number": 2, '
          '"replay_indices": [1, 2], '
          '"subnetworks": [{"builder_name": "linear", "iteration_number": 0}, '
          '{"builder_name": "dnn", "iteration_number": 0},'
          ' {"builder_name": "dnn", "iteration_number": 1}]}',
          serialized,
      )
      deserialized_arch = _Architecture.deserialize(serialized)
      self.assertEqual(
          arch.ensemble_candidate_name,
          deserialized_arch.ensemble_candidate_name,
      )
      self.assertEqual(
          arch.ensembler_name, deserialized_arch.ensembler_name
      )
      self.assertEqual(
          arch.subnetworks_grouped_by_iteration,
          deserialized_arch.subnetworks_grouped_by_iteration,
      )
      self.assertEqual(global_step, deserialized_arch.global_step)
  
file_path: adanet/adanet/core/architecture_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from adanet.core.architecture import _Architecture
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the ArchitectureTest obj's underlying member method code with example usage: obj.test_serialization_lifecycle() without return types