def METHOD_NAME(
    self,
    input_ids: paddle.Tensor,
    token_type_ids: Optional[paddle.Tensor] = None,
    position_ids: Optional[paddle.Tensor] = None,
    attention_mask: Optional[paddle.Tensor] = None,
    masked_positions: Optional[paddle.Tensor] = None,
    soft_token_ids: Optional[paddle.Tensor] = None,
    encoder_ids: Optional[paddle.Tensor] = None,
    labels: Optional[paddle.Tensor] = None,
    return_dict: Optional[bool] = None,
    **kwargs: Dict[str, Any]
):
    return_dict = return_dict if return_dict is not None else False
    return_hidden_states = kwargs.get("return_hidden_states", False)
    input_dict = {
        "input_ids": input_ids,
        "token_type_ids": token_type_ids,
        "position_ids": position_ids,
        "masked_positions": masked_positions,
        "soft_token_ids": soft_token_ids,
        "attention_mask": attention_mask,
        "encoder_ids": encoder_ids,
        **kwargs,
    }
    input_dict = self.template.process_batch(input_dict)
    input_dict = {**input_dict, **kwargs}
    model_inputs = {k: input_dict[k] for k in input_dict if k in self.forward_keys}
    if "masked_positions" in model_inputs:
        model_inputs.pop("masked_positions")
    model_outputs = self.plm(**model_inputs, return_dict=True)
    if isinstance(model_outputs, MaskedLMOutput):
        if self.verbalizer is not None:
            logits = self.verbalizer.process_outputs(model_outputs.logits, input_dict["masked_positions"])
            num_labels = len(self.verbalizer.label_words)
        else:
            raise Exception("Verbalizer is required when model uses the MaskedLM head")
    elif isinstance(model_outputs, SequenceClassifierOutput):
        logits = model_outputs.logits
        num_labels = self.plm.num_labels if self.plm.num_labels is not None else self.plm.num_labels
    elif isinstance(model_outputs, MultipleChoiceModelOutput):
        logits = model_outputs.logits
        num_labels = -1
    else:
        raise Exception(f"Model type not support yet: {type(model_outputs)}")
    loss = None
    if labels is not None:
        if num_labels == 1:
            loss_fct = paddle.nn.MSELoss()
            loss = loss_fct(logits, labels)
        elif num_labels > 0 and (labels.dtype == paddle.int64 or labels.dtype == paddle.int32):
            loss_fct = paddle.nn.CrossEntropyLoss()
            loss = loss_fct(logits.reshape((-1, num_labels)), labels.reshape((-1,)))
        else:
            loss_fct = paddle.nn.BCEWithLogitsLoss()
            loss = loss_fct(logits, labels)
    if not return_dict:
        output = (logits,)
        if return_hidden_states:
            output = output + (model_outputs.logits,)
        if loss is not None:
            return (loss,) + output
        if isinstance(output, (list, tuple)) and len(output) == 1:
            output = output[0]
        return output
    return SequenceClassifierOutput(
        loss=loss,
        logits=logits,
        hidden_states=model_outputs.logits,
    )