'Adds the output layer and loss function.
Args:
prev_layer:  Output of last layer of main network.
out_dims:    Number of output dimensions, 0, 1 or 2.
out_func:    Output non-linearity. \'s\' or \'c\'=softmax, \'l\'=logistic.
num_classes: Number of outputs/size of last output dimension.'

def _AddOutputs(self, prev_layer, out_dims, out_func, num_classes):

    height_in = shapes.tensor_dim(prev_layer, dim=1)
    (logits, outputs) = self._AddOutputLayer(prev_layer, out_dims, out_func, num_classes)
    if (self.mode == 'train'):
        self.loss = self._AddLossFunction(logits, height_in, out_dims, out_func)
        tf.summary.scalar('loss', self.loss)
    elif (out_dims == 0):
        self.labels = tf.slice(self.labels, [0, 0], [(-1), 1])
        self.labels = tf.reshape(self.labels, [(-1)])
    logging.info('Final    output=%s', outputs)
    logging.info('Labels    tensor=%s', self.labels)
    self.output = outputs
