code: def test_subnetwork_metrics(self, use_tpu):
      with context.graph_mode():
          self.setup_graph()
          spec = self._estimator_spec
          if not use_tpu:
              spec = spec.as_estimator_spec()
          metrics = tu.create_subnetwork_metrics(
              self._metric_fn,
              use_tpu=use_tpu,
              features=self._features,
              labels=self._labels,
              estimator_spec=spec,
          )
          actual = self._run_metrics(metrics.eval_metrics_tuple())
  
          expected = {"loss": 2.0, "metric_1": 1.0, "metric_2": 2.0}
          self.assertEqual(actual, expected)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core.architecture import _Architecture
  from adanet.core.eval_metrics import _call_eval_metrics
  import adanet.core.testing_utils
  import tensorflow.compat.v2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 6 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_subnetwork_metrics(use_tpu) without return types