class_docstr: This class tests for different I/O feature data types for an .mlmodel
  It will cover the following areas to test for:
  - All features must have a valid type
  - Multiarrays must have a valid dataType. Inputs must specify shape. Shape must have >= 0 elements
  - Images must have a valid colorspace. width & height have to be >= 0
  - Dictionaries must have a valid key type
class_docstr_tok: ["This","class","tests","for","different","I\/O","feature","data","types","for","an",".mlmodel","It","will","cover","the","following","areas","to","test","for",":","-","All","features","must","have","a","valid","type","-","Multiarrays","must","have","a","valid","dataType",".","Inputs","must","specify","shape",".","Shape","must","have",">","=","0","elements","-","Images","must","have","a","valid","colorspace",".","width","&","height","have","to","be",">","=","0","-","Dictionaries","must","have","a","valid","key","type"]
code: def test_image_output_bgr(self):
      input_shape = (3, 15, 25)
      input_features = [
          ("data", coremltools.models.datatypes.Array(*input_shape))
      ]
      output_features = [
          ("target", coremltools.models.datatypes.Array(*input_shape))
      ]
      builder = coremltools.models.neural_network.NeuralNetworkBuilder(
          input_features, output_features
      )
      builder.add_elementwise(
          "Identity",
          input_names=["data"],
          output_name="target",
          mode="ADD",
          alpha=0.0,
      )
      spec = builder.spec
      output = spec.description.output[0]
      output.type.imageType.colorSpace = coremltools.proto.FeatureTypes_pb2.ImageFeatureType.ColorSpace.Value(
          "BGR"
      )
      output.type.imageType.height = input_shape[1]
      output.type.imageType.width = input_shape[2]
  
      coreml_model = coremltools.models.MLModel(spec)
      input_data = np.floor(np.random.rand(*input_shape) * 255)
  
      coreml_out = coreml_model.predict({"data": input_data})["target"]
      self.assertEqual(PIL.Image.Image, type(coreml_out))
      self.assertEqual("RGBA", coreml_out.mode)
      np.testing.assert_equal(
          np.uint8(input_data),
          np.array(coreml_out)[:, :, ::-1].transpose(2, 0, 1)[1:, :],
      )
  
imports: import coremltools
  from coremltools._deps import _HAS_KERAS2_TF, MSG_KERAS2_NOT_FOUND, _HAS_SKLEARN, MSG_SKLEARN_NOT_FOUND
  from coremltools.models.utils import _macos_version, _is_macos
  import unittest
  import numpy
  import pytest
  import PIL.Image
label_desc: Use image node_id 15 for calling the TestIODataTypes obj's underlying member method code with example usage: obj.test_image_output_bgr() without return types