For a machine learning task, I am transforming two tensors, as shown in code snippet (1), in order to make them fit to the expected format from pytorch-lightning\'s ROC metric.