code: def test_forward(self, model, use_pf, fp16):
      words = ["Hello", "world"]
      normalized_word_boxes = [637, 773, 693, 782], [698, 773, 733, 782]
  
      token_boxes = []
      for word, box in zip(words, normalized_word_boxes):
          word_tokens = tokenizer.tokenize(word)
          token_boxes.extend([box] * len(word_tokens))
  
      # add bounding boxes of cls + sep tokens
      token_boxes = (
          [[0, 0, 0, 0]] + token_boxes + [[1000, 1000, 1000, 1000]]
      )
  
      encoding = tokenizer(" ".join(words), return_tensors="pt")
      input_ids = encoding["input_ids"]
      attention_mask = encoding["attention_mask"]
      token_type_ids = encoding["token_type_ids"]
      bbox = torch.tensor([token_boxes])
  
      if not use_pf:
          input_ids = input_ids.cuda()
          attention_mask = attention_mask.cuda()
          bbox = bbox.cuda()
          token_type_ids = token_type_ids.cuda()
  
      output = model(
          input_ids=input_ids,
          bbox=bbox,
          attention_mask=attention_mask,
          token_type_ids=token_type_ids,
          output_hidden_states=True,
      )
      print("forward:", output.hidden_states[0][0])
      torch.save(
          output.hidden_states,
          f"output-{'pf' if use_pf else 'non-pf'}-{'fp16' if fp16 else 'fp32'}.pt",
      )
      assert isinstance(output.hidden_states[0][0], torch.Tensor)
  
file_path: parallelformers/tests/layoutlm/layoutlm_model.py
imports: import os
  import unittest
  from argparse import ArgumentParser
  import torch
  from transformers import AutoModel, AutoTokenizer
  from parallelformers import parallelize
label_desc: Use image node_id 1 for calling the TestModel obj's underlying member method code with example usage: obj.test_forward(model, use_pf, fp16) without return types