def forward(self,
                input_ids,
                bbox=None,
                attention_mask=None,
                token_type_ids=None,
                position_ids=None,
                output_hidden_states=False):
        r"""
        The LayoutLMForTokenClassification forward method, overrides the __call__() special method.

        Args:
            input_ids (Tensor):
                See :class:`LayoutLMModel`.
            bbox (Tensor):
                See :class:`LayoutLMModel`.
            attention_mask (list, optional):
                See :class:`LayoutLMModel`.
            token_type_ids (Tensor, optional):
                See :class:`LayoutLMModel`.
            position_ids(Tensor, optional):
                See :class:`LayoutLMModel`.
            output_hidden_states(Tensor, optional):
                See :class:`LayoutLMModel`.


        Returns:
            Tensor: Returns tensor `logits`, a tensor of the input token classification logits.
            Shape as `[batch_size, sequence_length, num_classes]` and dtype as `float32`.

        Example:
            .. code-block::

                import paddle
                from paddlenlp.transformers import LayoutLMFForTokenClassification
                from paddlenlp.transformers import LayoutLMFTokenizer

                tokenizer = LayoutLMFTokenizer.from_pretrained('layoutlm-base-uncased')
                model = LayoutLMFForTokenClassification.from_pretrained('layoutlm-base-uncased', num_classes=2)

                inputs = tokenizer("Welcome to use PaddlePaddle and PaddleNLP!")
                inputs = {k:paddle.to_tensor([v]) for (k, v) in inputs.items()}

                logits = model(**inputs)
                print(logits.shape)
                # [1, 13, 2]

        """
        if attention_mask is not None:
            attention_mask = attention_mask.unsqueeze(1).unsqueeze(2).type(torch.long)
        outputs = self.layoutlm(
            input_ids=input_ids,
            bbox=bbox,
            attention_mask=attention_mask,
            token_type_ids=token_type_ids,
            position_ids=position_ids,
            output_hidden_states=False)
        sequence_output = outputs[0]
        sequence_output = self.dropout(sequence_output)
        logits = self.classifier(sequence_output)
        return logits

        The LayoutLMForTokenClassification forward method, overrides the __call__() special method.

        Args:
            input_ids (Tensor):
                See :class:`LayoutLMModel`.
            bbox (Tensor):
                See :class:`LayoutLMModel`.
            attention_mask (list, optional):
                See :class:`LayoutLMModel`.
            token_type_ids (Tensor, optional):
                See :class:`LayoutLMModel`.
            position_ids(Tensor, optional):
                See :class:`LayoutLMModel`.
            output_hidden_states(Tensor, optional):
                See :class:`LayoutLMModel`.


        Returns:
            Tensor: Returns tensor `logits`, a tensor of the input token classification logits.
            Shape as `[batch_size, sequence_length, num_classes]` and dtype as `float32`.

        Example:
            .. code-block::

                import paddle
                from paddlenlp.transformers import LayoutLMFForTokenClassification
                from paddlenlp.transformers import LayoutLMFTokenizer

                tokenizer = LayoutLMFTokenizer.from_pretrained('layoutlm-base-uncased')
                model = LayoutLMFForTokenClassification.from_pretrained('layoutlm-base-uncased', num_classes=2)

                inputs = tokenizer("Welcome to use PaddlePaddle and PaddleNLP!")
                inputs = {k:paddle.to_tensor([v]) for (k, v) in inputs.items()}

                logits = model(**inputs)
                print(logits.shape)
                # [1, 13, 2]

        
ptstructure/vqa/pytorchnlp/transformers/layoutlm/modeling.py