paddlenlp/metrics/glue.py
def compute(self, pred, label, *args):
        """
        Processes the pred tensor, and returns the indices of the maximum of each
        sample.

        Args:
            pred (Tensor):
                The predicted value is a Tensor with dtype float32 or float64.
                Shape is [batch_size, 1].
            label (Tensor):
                The ground truth value is Tensor with dtype int64, and its
                shape is [batch_size, 1].

        Returns:
            tuple: A tuple of preds and label. Each shape is
            [batch_size, 1], with dtype float32 or float64.

        """
        preds = paddle.argsort(pred, descending=True)[:, :1]
        return (preds, label)

        Processes the pred tensor, and returns the indices of the maximum of each
        sample.

        Args:
            pred (Tensor):
                The predicted value is a Tensor with dtype float32 or float64.
                Shape is [batch_size, 1].
            label (Tensor):
                The ground truth value is Tensor with dtype int64, and its
                shape is [batch_size, 1].

        Returns:
            tuple: A tuple of preds and label. Each shape is
            [batch_size, 1], with dtype float32 or float64.

        
Processes the pred tensor, and returns the indices of the maximum of each
sample.
Processes the pred tensor and returns the indices of the maximum of each sample .
def compute(self, pred, label, *args):
        preds = paddle.argsort(pred, descending=True)[:, :1]
        return (preds, label)
def compute ( self , pred , label , * args ) : preds = paddle . argsort ( pred , descending = True ) [ : , : 1 ] return ( preds , label )
Processes the pred tensor, and returns the indices of the maximum of each
sample.
Processes the pred tensor and returns the indices of the maximum of each sample .
"""
        Processes the pred tensor, and returns the indices of the maximum of each
        sample.

        Args:
            pred (Tensor):
                The predicted value is a Tensor with dtype float32 or float64.
                Shape is [batch_size, 1].
            label (Tensor):
                The ground truth value is Tensor with dtype int64, and its
                shape is [batch_size, 1].

        Returns:
            tuple: A tuple of preds and label. Each shape is
            [batch_size, 1], with dtype float32 or float64.

        """
A tuple of preds and label. Each shape is
[batch_size, 1], with dtype float32 or float64.
A tuple of preds and label . Each shape is [ batch_size 1 ] with dtype float32 or float64 .
tuple
self
pred
The predicted value is a Tensor with dtype float32 or float64.
Shape is [batch_size, 1].
The predicted value is a Tensor with dtype float32 or float64 . Shape is [ batch_size 1 ] .
label
The ground truth value is Tensor with dtype int64, and its
shape is [batch_size, 1].
The ground truth value is Tensor with dtype int64 and its shape is [ batch_size 1 ] .