code: def video_loss(top_out, targets, model_hparams, vocab_size, weights_fn):
    
    del vocab_size  # unused arg
    logits = top_out
    logits = tf.reshape(logits, [-1] + common_layers.shape_list(logits)[2:])
    targets = tf.reshape(targets, [-1] + common_layers.shape_list(targets)[2:])
    cutoff = getattr(model_hparams, "video_modality_loss_cutoff", 0.01)
    return common_layers.padded_cross_entropy(
        logits,
        targets,
        model_hparams.label_smoothing,
        cutoff=cutoff,
        weights_fn=weights_fn)
docs: Compute loss numerator and denominator for one shard of output.