human
Complete this python program:
def get_softmax_loss_fn(label_smoothing):
assistant
#Here is the Python code you requested.

    """Returns sparse or dense loss function depending on the label_smoothing.
    Args:
    label_smoothing: weight for label smoothing
    Returns:
    a function which takes labels and predictions as arguments and returns
    a softmax loss for the selected type of labels (sparse or dense).
    """
    if (label_smoothing > 0):
        def loss_fn(labels, logits):
            return tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels)
    else:
        def loss_fn(labels, logits):
            return tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=labels)
    return loss_fn