def set_output(self, output_names, output_dims):
        """
        Set the outputs of the network spec.

        Parameters
        ----------
        output_names: list of str
            The output names of the network.

        output_dims: [tuple]
            The output dimensions of the network. The ordering of ``output_dims`` is the same
            as ``output_names``.

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

            # Set the neural network spec outputs to be 3 dimensional vector feature1 and
            # 4 dimensional vector feature2.
            builder.set_output(output_names=["feature1", "feature2"], output_dims=[(3,), (4,)])

        See Also
        --------
        set_input, set_class_labels
        """

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

        spec = self.spec
        for idx, dim in enumerate(output_dims):
            spec.description.output[idx].type.multiArrayType.ClearField("shape")
            spec.description.output[idx].type.multiArrayType.shape.extend(dim)
            spec.description.output[
                idx
            ].type.multiArrayType.dataType = _proto.Model_pb2.ArrayFeatureType.DOUBLE

            spec.description.output[idx].name = output_names[idx]

        Set the outputs of the network spec.

        Parameters
        ----------
        output_names: list of str
            The output names of the network.

        output_dims: [tuple]
            The output dimensions of the network. The ordering of ``output_dims`` is the same
            as ``output_names``.

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

            # Set the neural network spec outputs to be 3 dimensional vector feature1 and
            # 4 dimensional vector feature2.
            builder.set_output(output_names=["feature1", "feature2"], output_dims=[(3,), (4,)])

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