code: def _validate_word_tagging_result(
      self,
      scores: torch.Tensor,
      ts_results: List[List[Dict[str, float]]],
      vocab: Vocabulary,
  ):
      bsize, max_seq_len, num_labels = scores.size()
      self.assertEqual(
          len(ts_results),
          bsize,
          "Batch size must match for pytorch and torchscript class",
      )
      self.assertEqual(
          len(ts_results[0]),
          max_seq_len,
          "Max seq length must match for pytorch and torchscript class",
      )
      self.assertEqual(
          len(ts_results[0][0]),
          num_labels,
          "Number of labels must match for pytorch and torchscript class",
      )
      self.assertEqual(
          len(ts_results[0][0]),
          len(vocab),
          "Number of labels should be same as vocab length",
      )
  
      for i in range(bsize):
          for j in range(max_seq_len):
              for label, score in ts_results[i][j].items():
                  self.assertAlmostEqual(
                      score,
                      scores[i][j][vocab.idx[label]],
                      (
                          "Scores for [{}][{}][{}] element must match for "
                          "pytorch and torchscript class"
                      ).format(i, j, vocab.idx[label]),
                  )
  
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 10 for calling the OutputLayerTest obj's underlying member method code with example usage: obj._validate_word_tagging_result(scores, ts_results, vocab) without return types