code: def test_torchscript_word_tagging_output_layer(
      self, num_labels, seq_lens
  ):
      batch_size = len(seq_lens)
      vocab = Vocabulary(
          [
              OutputLayerTest._generate_random_string()
              for _ in range(num_labels)
          ]
      )
  
      word_layer = WordTaggingOutputLayer.from_config(
          config=WordTaggingOutputLayer.Config(), labels=vocab
      )
      crf_layer = CRFOutputLayer.from_config(
          config=CRFOutputLayer.Config(), labels=vocab
      )
  
      (
          logits,
          seq_lens_tensor,
      ) = OutputLayerTest._generate_word_tagging_inputs(
          batch_size, num_labels, seq_lens
      )
      context = {"seq_lens": seq_lens_tensor}
  
      torchsript_word_layer = word_layer.torchscript_predictions()
      torchscript_crf_layer = crf_layer.torchscript_predictions()
  
      self._validate_word_tagging_result(
          word_layer.get_pred(logits, None, context)[1],
          torchsript_word_layer(logits, context),
          vocab,
      )
      self._validate_word_tagging_result(
          crf_layer.get_pred(logits, None, context)[1],
          torchscript_crf_layer(logits, context),
          vocab,
      )
  
imports: import random
  import string
  import sys
  from contextlib import contextmanager
  from io import StringIO
  from typing import Dict, List
  import caffe2.python.hypothesis_test_util
  import hypothesis.strategies
  import numpy
  import torch
  from hypothesis import given, settings
  from pytext.common.constants import SpecialTokens
  from pytext.data.tensorizers import LabelTensorizer
  from pytext.data.utils import Vocabulary
  from pytext.loss import CrossEntropyLoss
  from pytext.models.output_layers.doc_classification_output_layer import ClassificationOutputLayer
  from pytext.models.output_layers.intent_slot_output_layer import IntentSlotOutputLayer
  from pytext.models.output_layers.word_tagging_output_layer import CRFOutputLayer, WordTaggingOutputLayer
label_desc: Use image node_id 3 for calling the OutputLayerTest obj's underlying member method code with example usage: obj.test_torchscript_word_tagging_output_layer(num_labels, seq_lens) without return types