class_docstr: Test that the boolean flag `use_float_arraytype` correctly changes the datatype of the
  network's inputs and outputs and produces a spec that the `MLModel` class can call `predict`
  with.
class_docstr_tok: ["Test","that","the","boolean","flag","`","use_float_arraytype","`","correctly","changes","the","datatype","of","the","network","'s","inputs","and","outputs","and","produces","a","spec","that","the","`","MLModel","`","class","can","call","`","predict","`","with","."]
code: def _test_use_float_array_helper(self, use_float_arraytype):
      input_features = [("data", datatypes.Array(3))]
      output_features = [("probs", None)]
      builder = NeuralNetworkBuilder(
          input_features=input_features,
          output_features=output_features,
          use_float_arraytype=use_float_arraytype,
      )
      weights = np.ones((3, 3))
      builder.add_inner_product(
          name="ip1",
          W=weights,
          b=None,
          input_channels=3,
          output_channels=3,
          has_bias=False,
          input_name="data",
          output_name="probs",
      )
      spec = builder.spec
      array_feature_type = (
          coremltools.proto.FeatureTypes_pb2.ArrayFeatureType.FLOAT32
          if use_float_arraytype
          else coremltools.proto.FeatureTypes_pb2.ArrayFeatureType.DOUBLE
      )
      for input in spec.description.input:
          self.assertEqual(
              input.type.multiArrayType.dataType, array_feature_type
          )
      for output in spec.description.input:
          self.assertEqual(
              output.type.multiArrayType.dataType, array_feature_type
          )
  
      # Assert that the generated spec is functional
      mlmodel = MLModel(spec)
      data = np.ones((3,))
      data_dict = {"data": data}
      try:
          predictions = mlmodel.predict(data_dict)
      except Exception as e:
          self.fail(e)
      self.assertTrue(np.allclose(predictions["probs"], np.ones(3) * 3))
  
imports: import numpy
  import pytest
  import unittest
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.types.type_mapping import np_val_to_py_type
  from coremltools.models import MLModel, datatypes
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models.neural_network.quantization_utils import _convert_array_to_nbit_quantized_bytes, quantize_weights
  from coremltools.models.utils import _is_macos, _macos_version
label_desc: Use image node_id 1 for calling the UseFloatArraytypeTest obj's underlying member method code with example usage: obj._test_use_float_array_helper(use_float_arraytype) without return types