def inspect_loss_layers(self):
        """ Prints the summary for the loss layer.
        """
        n_loss_layers = len(self.nn_spec.updateParams.lossLayers)
        if n_loss_layers < 1:
            print("no loss layer detected.")
        for i, loss_layer in enumerate(self.nn_spec.updateParams.lossLayers[::-1]):
            loss_type = loss_layer.WhichOneof("LossLayerType")
            loss_name = loss_layer.name
            loss_input = None
            loss_target = None
            if loss_type == "categoricalCrossEntropyLossLayer":
                loss_input = loss_layer.categoricalCrossEntropyLossLayer.input
                loss_target = loss_layer.categoricalCrossEntropyLossLayer.target
            elif loss_type == "meanSquaredErrorLossLayer":
                loss_input = loss_layer.meanSquaredErrorLossLayer.input
                loss_target = loss_layer.meanSquaredErrorLossLayer.target

            print(
                "[Id: {}], Name: {} (Type: {})".format(
                    n_loss_layers - i - 1, loss_name, loss_type
                )
            )
            print(" " * 10 + "Loss Input: {}".format(loss_input))
            print(" " * 10 + "Loss Target: {}".format(loss_target))
 Prints the summary for the loss layer.
        
coremltools/models/neural_network/builder.py