code: def test_build_subnetwork(self, builder_params, want_name):
      with tf.Graph().as_default() as g, self.test_session(
          graph=g
      ) as sess:
          data = np.concatenate(
              [
                  np.ones((1, _IMAGE_DIM, _IMAGE_DIM, 1)),
                  2.0 * np.ones((1, _IMAGE_DIM, _IMAGE_DIM, 1)),
              ]
          )
          features = {"x": tf.constant(data)}
          labels = tf.constant([0, 1])
          training = True
          mode = tf.estimator.ModeKeys.TRAIN
          head = tf.contrib.estimator.binary_classification_head(
              loss_reduction=tf.losses.Reduction.SUM
          )
          ensemble = None
          name = None
          subnetwork = None
          builders = []
          for builder_param in builder_params:
              builders.append(
                  _builder(
                      checkpoint_dir=self.test_subdirectory,
                      **builder_param,
                  )
              )
          for idx, builder in enumerate(builders):
              name = builder.name
              # Pass the subnetworks of previous builders to the next builder.
              with tf.variable_scope("subnetwork_{}".format(idx)):
                  subnetwork = builder.build_subnetwork(
                      features=features,
                      logits_dimension=head.logits_dimension,
                      training=training,
                      iteration_step=tf.train.get_or_create_global_step(),
                      summary=_FakeSummary(),
                      previous_ensemble=ensemble,
                  )
                  logits = subnetwork.logits
                  weighted_subnetworks = []
                  if ensemble:
                      logits += ensemble.logits
                      weighted_subnetworks = (
                          ensemble.weighted_subnetworks
                      )
                  ensemble = adanet.Ensemble(
                      weighted_subnetworks=weighted_subnetworks
                      + [
                          adanet.WeightedSubnetwork(
                              name=None,
                              logits=logits,
                              weight=None,
                              subnetwork=subnetwork,
                          )
                      ],
                      logits=logits,
                      bias=0.0,
                  )
  
          estimator_spec = head.create_estimator_spec(
              features=features,
              labels=labels,
              mode=mode,
              train_op_fn=lambda loss: tf.no_op(),
              logits=ensemble.logits,
          )
          sess.run(tf.global_variables_initializer())
          train_op = builders[-1].build_subnetwork_train_op(
              subnetwork,
              estimator_spec.loss,
              var_list=None,
              labels=labels,
              iteration_step=tf.train.get_or_create_global_step(),
              summary=_FakeSummary(),
              previous_ensemble=ensemble,
          )
          for _ in range(10):
              sess.run(train_op)
          self.assertEqual(want_name, name)
          self.assertGreater(sess.run(estimator_spec.loss), 0.0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  from absl import flags
  from absl.testing import parameterized
  import adanet
  from adanet.research.improve_nas.trainer import improve_nas
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the ImproveNasBuilderTest obj's underlying member method code with example usage: obj.test_build_subnetwork(builder_params, want_name) without return types