class_docstr: Tests for DP-enabled multilabel heads.
docstr: Tests that an Estimator built with this head works.
docstr_tok: ["Tests","that","an","Estimator","built","with","this","head","works","."]
code: def testCreateTPUEstimatorSpec(self):
      """Tests that an Estimator built with this head works."""
  
      (
          train_features,
          train_labels,
      ) = test_utils.make_multilabel_input_data(256)
      feature_columns = []
      for key in train_features:
          feature_columns.append(
              tf.feature_column.numeric_column(key=key)
          )
  
      head = multi_label_head.DPMultiLabelHead(3)
      optimizer = DPKerasSGDOptimizer(
          learning_rate=0.5,
          l2_norm_clip=1.0,
          noise_multiplier=0.0,
          num_microbatches=2,
      )
      model_fn = test_utils.make_model_fn(
          head, optimizer, feature_columns
      )
      classifier = estimator.Estimator(model_fn=model_fn)
  
      classifier.train(
          input_fn=test_utils.make_input_fn(
              train_features, train_labels, True
          ),
          steps=4,
      )
  
      (
          test_features,
          test_labels,
      ) = test_utils.make_multilabel_input_data(64)
      classifier.evaluate(
          input_fn=test_utils.make_input_fn(
              test_features, test_labels, False
          ),
          steps=4,
      )
  
      (
          predict_features,
          predict_labels,
      ) = test_utils.make_multilabel_input_data(64)
      classifier.predict(
          input_fn=test_utils.make_input_fn(
              predict_features, predict_labels, False
          )
      )
  
file_path: privacy/tensorflow_privacy/privacy/estimators/multi_label_head_test.py
imports: import numpy
  import tensorflow
  from tensorflow_privacy.privacy.estimators import multi_label_head
  from tensorflow_privacy.privacy.estimators import test_utils
  from tensorflow_privacy.privacy.optimizers.dp_optimizer_keras import DPKerasSGDOptimizer
  from tensorflow_estimator.python.estimator import estimator
label_desc: Use image node_id 2 for calling the DPMultiLabelHeadTest obj's underlying member method code with example usage: obj.testCreateTPUEstimatorSpec() without return types