Make ignore_index
work when all batch elements are to be ignored
#2685
Labels
enhancement
New feature or request
🚀 Feature
The
ignore_index
argument in e.g. theAUROC
metric allows one to specify a label that will be ignored. This works great when some batch elements are to be ignored. When calling the metric, and providing a tensor as input where all entries are theignore_index
, we get anIndexError
.Motivation
Having batches without labels may sound counterintuitive at first, but in multitask problems this can happen quite easily, when a metric only tracks a given subtask and batches are random.
Pitch
It would be helpful if this just worked (and maybe print a warning) - maybe return 0 or nan?
Alternatives
Right now, this needs to be handled manually like
or, when calling
compute
after someupdate
stepsThe text was updated successfully, but these errors were encountered: