def set_input(self, input_names, input_dims):
        """
        Set the inputs of the network spec.

        Parameters
        ----------
        input_names: list of str
            The input names of the network.

        input_dims: [tuple]
            The input dimensions of the network. The ordering of ``input_dims``
            is the same as ``input_names``.

        Examples
        --------
        .. sourcecode:: python

            # Set the neural network spec inputs to be 3 dimensional vector data1 and
            # 4 dimensional vector data2.
            builder.set_input(input_names=["data1", "data2"], input_dims=[(3,), (4,)])

        See Also
        --------
        set_output, set_class_labels
        """

        if len(input_names) != len(input_dims):
            raise ValueError("input_names and input_dims must be of the same sizes.")

        spec = self.spec
        for idx, dim in enumerate(input_dims):
            if (
                hasattr(self, "_disable_rank5_shape_mapping")
                and self._disable_rank5_shape_mapping
            ):
                input_shape = dim
            else:
                if len(dim) == 3:
                    input_shape = (dim[0], dim[1], dim[2])
                elif len(dim) == 2:
                    input_shape = (dim[1],)
                elif len(dim) == 1:
                    input_shape = tuple(dim)
                else:
                    raise RuntimeError(
                        "Attempting to add a neural network "
                        + "input with rank "
                        + str(len(dim))
                        + ". All networks should take inputs of rank 1 or 3."
                    )

            spec.description.input[idx].type.multiArrayType.ClearField("shape")
            spec.description.input[idx].type.multiArrayType.shape.extend(input_shape)

            # TODO: if it's an embedding, this should be integer
            spec.description.input[
                idx
            ].type.multiArrayType.dataType = _proto.Model_pb2.ArrayFeatureType.DOUBLE

            spec.description.input[idx].name = input_names[idx]

        Set the inputs of the network spec.

        Parameters
        ----------
        input_names: list of str
            The input names of the network.

        input_dims: [tuple]
            The input dimensions of the network. The ordering of ``input_dims``
            is the same as ``input_names``.

        Examples
        --------
        .. sourcecode:: python

            # Set the neural network spec inputs to be 3 dimensional vector data1 and
            # 4 dimensional vector data2.
            builder.set_input(input_names=["data1", "data2"], input_dims=[(3,), (4,)])

        See Also
        --------
        set_output, set_class_labels
        
coremltools/models/neural_network/builder.py