code: def testRaisesErrorForInvalidNonSparseSettings(self):
      with self.assertRaises(ValueError):
          tf_metric_wrapper.tf_metric_computations(
              [
                  tf.keras.metrics.SparseCategoricalCrossentropy(
                      name="sparse_categorical_crossentropy"
                  )
              ],
              aggregation_type=metric_types.AggregationType(
                  micro_average=True
              ),
          )
  
imports: from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import tf_metric_wrapper
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 3 for calling the NonConfusionMatrixMetricsTest obj's underlying member method code with example usage: obj.testRaisesErrorForInvalidNonSparseSettings() without return types