def set_mean_squared_error_loss(self, name, input_feature=None):
        """
        input_feature: [(str, datatypes.Array)] or None
            The input feature of the loss layer. Each feature is a
            ``(name, array)`` tuple, where ``name`` is the name of the model's
            tensor our loss will be attached to, and ``array`` is a
            ``datatypes.Array`` object describing the shape of that tensor.
            Both the name and the array's shape must be provided in the tuple.

        Examples
        --------

            feature = [('output_tensor', datatypes.Array((299, 299, 3)))]
        """
        if self.spec is None:
            return

        if name in self.layer_specs:
            raise ValueError("Name %s is already used." % name)

        if input_feature is None:
            raise ValueError("Loss Layer input must be specified")

        if not isinstance(input_feature, tuple):
            raise ValueError(
                "Loss layer input must be a tuple of type (string, datatype)"
            )

        (fname, ftype) = input_feature
        if not isinstance(fname, str):
            raise ValueError(
                "Loss layer input must be a tuple of type (string, datatype)"
            )
        if not isinstance(ftype, datatypes.Array):
            raise ValueError(
                "Loss layer input must be a tuple of type (string, datatype)"
            )

        target = fname + "_true"

        loss_layer = self.nn_spec.updateParams.lossLayers.add()
        self.layers.append(name)
        self.layer_specs[name] = loss_layer
        loss_layer.name = name

        output_names = [x.name for x in self.spec.description.output]
        if target in output_names:
            raise ValueError(
                "Loss Layer target (%s) must not be a model output" % target
            )

        loss_layer.meanSquaredErrorLossLayer.input = input_feature[0]
        loss_layer.meanSquaredErrorLossLayer.target = target

        training_inputs = self.spec.description.trainingInput
        training_inputs.extend(self.spec.description.input)
        training_input = training_inputs.add()
        training_input.name = target

        datatypes._set_datatype(training_input.type, input_feature[1])
        training_input.type.multiArrayType.dataType = _proto.Model_pb2.ArrayFeatureType.DOUBLE
        print(
            "Now adding input {} as target for mean squared error loss layer.".format(
                target
            )
        )

        input_feature: [(str, datatypes.Array)] or None
            The input feature of the loss layer. Each feature is a
            ``(name, array)`` tuple, where ``name`` is the name of the model's
            tensor our loss will be attached to, and ``array`` is a
            ``datatypes.Array`` object describing the shape of that tensor.
            Both the name and the array's shape must be provided in the tuple.

        Examples
        --------

            feature = [('output_tensor', datatypes.Array((299, 299, 3)))]
        
coremltools/models/neural_network/builder.py