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_keras_dense_model(self):
      model = keras.models.Sequential()
      model.add(
          keras.layers.Dense(
              3,
              activation="sigmoid",
              kernel_initializer="random_uniform",
              bias_initializer="random_uniform",
              input_dim=3,
          )
      )
      for key, dtype in self.number_data_type.items():
          try:
              input_data = np.random.rand(1, 3).astype(key)
              keras_out = model.predict(input_data)
              coreml_model = coremltools.converters.keras.convert(
                  model, input_names=["data"], output_names=["target"]
              )
              spec = coreml_model.get_spec()
              spec.description.output[
                  0
              ].type.multiArrayType.dataType = coremltools.proto.FeatureTypes_pb2.ArrayFeatureType.ArrayDataType.Value(
                  self._feature_data_type(dtype)
              )
              spec.description.input[
                  0
              ].type.multiArrayType.dataType = coremltools.proto.FeatureTypes_pb2.ArrayFeatureType.ArrayDataType.Value(
                  self._feature_data_type(dtype)
              )
              coreml_model = coremltools.models.MLModel(spec)
              coreml_out = coreml_model.predict(
                  {"data": np.expand_dims(input_data, 0)}
              )["target"]
              self.assertEqual(dtype, coreml_out.dtype)
              if dtype != np.int32:
                  for idx in range(0, len(keras_out)):
                      self.assertAlmostEqual(
                          keras_out[0][idx],
                          coreml_out[idx],
                          msg="{}\n{} != {}".format(
                              dtype, keras_out, coreml_out
                          ),
                          places=2,
                      )
          except KeyError:
              print("{} not supported. ".format(dtype))
  
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 12 for calling the TestIODataTypes obj's underlying member method code with example usage: obj.test_keras_dense_model() without return types