code: def _build_nas_aux_head(inputs, dimension, data_format):
      """Builds the auxiliary head described in the NAS paper."""
      shape = inputs.shape
      if shape.rank < 4:
          return None
      shape = shape.as_list()
      shape = shape[1:3] if data_format == "NHWC" else shape[2:4]
      if np.any(np.array(shape) < np.array([5, 5])):
          return None
  
      with tf.compat.v1.variable_scope("aux_logits"):
          with arg_scope(DATA_FORMAT_OPS, data_format=data_format):
              aux_logits = tf_slim.avg_pool2d(
                  inputs, [5, 5], stride=3, padding="SAME"
              )
              aux_logits = tf_slim.conv2d(
                  aux_logits, 128, [1, 1], scope="proj"
              )
              aux_logits = tf_slim.batch_norm(
                  aux_logits, scope="aux_bn0"
              )
              aux_logits = tf.nn.relu6(aux_logits)
              # Shape of feature map before the final layer.
              shape = aux_logits.shape
              shape = (
                  shape[1:3] if data_format == "NHWC" else shape[2:4]
              )
              aux_logits = tf_slim.conv2d(
                  aux_logits, 768, shape, padding="VALID"
              )
              aux_logits = tf_slim.batch_norm(
                  aux_logits, scope="aux_bn1"
              )
              aux_logits = tf.nn.relu6(aux_logits)
              aux_logits = tf.keras.layers.Flatten()(aux_logits)
              aux_logits = tf_slim.fully_connected(
                  aux_logits, dimension
              )
  
      return aux_logits
  
imports: import collections
  import os
  import string
  import time
  from absl import flags
  from absl import logging
  from model_search import block
  from model_search import block_builder
  from model_search import hparam
  from model_search import utils
  from model_search.proto import hparam_pb2
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
  import tf_slim
  from google.protobuf import text_format
label_desc: Use image node_id 20 for calling a global function with example usage: _build_nas_aux_head(inputs, dimension, data_format) and returns: aux_logits, None, None