docstr: Test converting a PredictResponse to a ClassificationResponse.
docstr_tok: ["Test","converting","a","PredictResponse","to","a","ClassificationResponse","."]
code: def test_convert_predict_response_classification(self):
      """Test converting a PredictResponse to a ClassificationResponse."""
      predict = predict_pb2.PredictResponse()
      output = predict.outputs["probabilities"]
      dim = output.tensor_shape.dim.add()
      dim.size = 3
      dim = output.tensor_shape.dim.add()
      dim.size = 2
      output.float_val.extend([1.0, 0.0, 0.9, 0.1, 0.8, 0.2])
  
      bundle = inference_utils.ServingBundle(
          "", "", "classification", "", "", True, "", "probabilities"
      )
      converted = common_utils.convert_predict_response(predict, bundle)
  
      self.assertEqual(
          "0", converted.result.classifications[0].classes[0].label
      )
      self.assertAlmostEqual(
          1, converted.result.classifications[0].classes[0].score
      )
      self.assertEqual(
          "1", converted.result.classifications[0].classes[1].label
      )
      self.assertAlmostEqual(
          0, converted.result.classifications[0].classes[1].score
      )
  
      self.assertEqual(
          "0", converted.result.classifications[1].classes[0].label
      )
      self.assertAlmostEqual(
          0.9, converted.result.classifications[1].classes[0].score
      )
      self.assertEqual(
          "1", converted.result.classifications[1].classes[1].label
      )
      self.assertAlmostEqual(
          0.1, converted.result.classifications[1].classes[1].score
      )
  
      self.assertEqual(
          "0", converted.result.classifications[2].classes[0].label
      )
      self.assertAlmostEqual(
          0.8, converted.result.classifications[2].classes[0].score
      )
      self.assertEqual(
          "1", converted.result.classifications[2].classes[1].label
      )
      self.assertAlmostEqual(
          0.2, converted.result.classifications[2].classes[1].score
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import numpy
  import tensorflow
  from tensorflow_serving.apis import classification_pb2
  from tensorflow_serving.apis import predict_pb2
  from tensorflow_serving.apis import regression_pb2
  from utils import common_utils
  from utils import inference_utils
  from utils import platform_utils
  from utils import test_utils
label_desc: Use image node_id 22 for calling the InferenceUtilsTest obj's underlying member method code with example usage: obj.test_convert_predict_response_classification() without return types