Could you check the dimensions of gt_labels and self.labels?
It seems self.labels uses two dimensions, while gt_labels has only one.
I’m not familiar with your use case, but you might be able to squeeze() one dimension of self.labels.