code: def make_regression_head(use_tpu):
      if use_tpu and head_lib:
          # AdaNet TPU currently requires the old head.
          return head_lib.regression_head(
              loss_reduction=tf_compat.v1.losses.Reduction.SUM_OVER_BATCH_SIZE
          )
      # TF 2.0 eliminates tf.contrib.
      return regression_head.RegressionHead(
          loss_reduction=tf_compat.SUM_OVER_BATCH_SIZE
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  import json
  import os
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core import testing_utils
  from adanet.core.tpu_estimator import TPUEstimator
  from adanet.subnetwork import Builder
  from adanet.subnetwork import Report
  from adanet.subnetwork import SimpleGenerator
  from adanet.subnetwork import Subnetwork
  import numpy
  import tensorflow.compat.v2
  from tensorflow_estimator.python.estimator.head import regression_head
label_desc: Use image node_id 1 for calling a global function with example usage: make_regression_head(use_tpu) and returns: regression_head, head_lib