(scores, labels, ignore=None)
return vscores, vlabels
Flattens predictions in the batch (binary case)
    Remove labels equal to 'ignore'
Flattens predictions in the batch (binary case)
    Remove labels equal to 'ignore'
Flattens predictions in the batch ( binary case ) Remove labels equal to ignore
def flatten_binary_scores(scores, labels, ignore=None):
    """
    Flattens predictions in the batch (binary case)
    Remove labels equal to 'ignore'
    """
    scores = scores.view(-1)
    labels = labels.view(-1)
    if ignore is None:
        return scores, labels
    valid = (labels != ignore)
    vscores = scores[valid]
    vlabels = labels[valid]
    return vscores, vlabels
def flatten_binary_scores ( scores , labels , ignore = None ) : scores = scores . view ( - 1 ) labels = labels . view ( - 1 ) if ignore is None : return scores , labels valid = ( labels != ignore ) vscores = scores [ valid ] vlabels = labels [ valid ] return vscores , vlabels