class_docstr: Adapted from the original WordpieceTokenizer tests.
class_docstr_tok: ["Adapted","from","the","original","WordpieceTokenizer","tests","."]
code: def testWordPieceOpAndVerifyOffsets(
      self,
      tokens,
      expected_subwords,
      vocab,
      expected_start=None,
      expected_end=None,
      unknown_token="[UNK]",
      token_out_type=dtypes.string,
      max_bytes_per_word=100,
  ):
      tokens_t = ragged_factory_ops.constant(tokens)
      tokenizer = FastWordpieceTokenizer(
          vocab=vocab,
          unknown_token=unknown_token,
          token_out_type=token_out_type,
          max_bytes_per_word=max_bytes_per_word,
          no_pretokenization=True,
      )
      subwords_t, begin_t, end_t = tokenizer.tokenize_with_offsets(
          tokens_t
      )
      self.assertAllEqual(subwords_t, expected_subwords)
  
      # Verify the indices by performing the following:
      # - Extract subwords and join them together to form the original tokens.
      # - Then compare the extracted tokens and original tokens.
      begin, end = self.evaluate((begin_t, end_t))
  
      # If expected start/end offsets were provided, check them explicitly.
      # Otherwise test the offsets by extracting subwords using token offsets
      # from the original 'tokens' input.
      if expected_start is None or expected_end is None:
          extracted_tokens = _GetTokensFromWordpieceOffsets(
              tokens, begin, end
          )
          self.assertAllEqual(extracted_tokens, tokens)
      else:
          self.assertAllEqual(begin, expected_start)
          self.assertAllEqual(end, expected_end)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import flags
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_text
  from tensorflow.lite.python import interpreter
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow_text.python.ops.fast_wordpiece_tokenizer import FastWordpieceTokenizer
label_desc: Use image node_id 1 for calling the FastWordpieceOpOriginalTest obj's underlying member method code with example usage: obj.testWordPieceOpAndVerifyOffsets(tokens, expected_subwords, vocab, expected_start, expected_end, unknown_token, token_out_type, max_bytes_per_word) without return types