class_docstr: Normalizes a tensor of UTF-8 strings.
class_docstr_tok: ["Normalizes","a","tensor","of","UTF-8","strings","."]
docstr: The actual function of normalization.
  
  Args:
    input: An N-dimensional `Tensor` or `RaggedTensor` of UTF-8 strings.
    get_offsets: bool. Whether to compute offsets or not.
  
  Returns:
    A tuple `(texts, offsets)` where:
      texts: is a `Tensor` or `RaggedTensor`.
      offsets: If `get_offsets`=True, it is a `RaggedTensor` of the
      byte offsets from the output to the input. Otherwise, it is None.
docstr_tok: ["The","actual","function","of","normalization",".","Args",":","input",":","An","N-dimensional","`","Tensor","`","or","`","RaggedTensor","`","of","UTF-8","strings",".","get_offsets",":","bool",".","Whether","to","compute","offsets","or","not",".","Returns",":","A","tuple","`","(","texts",",","offsets",")","`","where",":","texts",":","is","a","`","Tensor","`","or","`","RaggedTensor","`",".","offsets",":","If","`","get_offsets","`","=True",",","it","is","a","`","RaggedTensor","`","of","the","byte","offsets","from","the","output","to","the","input",".","Otherwise",",","it","is","None","."]
code: def _normalize_with_offsets_helper(
      self, input, get_offsets
  ):  # pylint: disable=redefined-builtin
      r"""The actual function of normalization.
  
      Args:
        input: An N-dimensional `Tensor` or `RaggedTensor` of UTF-8 strings.
        get_offsets: bool. Whether to compute offsets or not.
  
      Returns:
        A tuple `(texts, offsets)` where:
          texts: is a `Tensor` or `RaggedTensor`.
          offsets: If `get_offsets`=True, it is a `RaggedTensor` of the
          byte offsets from the output to the input. Otherwise, it is None.
      """
      name = None
      with ops.name_scope(
          name, "FastBertNormalize", [input, self._model]
      ):
          # Check that the types are expected and the ragged rank is appropriate.
          input = ragged_tensor.convert_to_tensor_or_ragged_tensor(
              input
          )
          rank = input.shape.ndims
          if rank is None:
              raise ValueError("input must have a known rank.")
  
          if rank == 0:
              (
                  normalized_texts,
                  offsets,
              ) = self._normalize_with_offsets_helper(
                  array_ops_stack.stack([input]), get_offsets
              )
              return (
                  normalized_texts.values,
                  offsets.values if get_offsets else None,
              )
  
          elif rank > 1:
              if not ragged_tensor.is_ragged(input):
                  input = ragged_tensor.RaggedTensor.from_tensor(
                      input, ragged_rank=rank - 1
                  )
              (
                  normalized_texts,
                  offsets,
              ) = self._normalize_with_offsets_helper(
                  input.flat_values, get_offsets
              )
              if get_offsets:
                  offsets = offsets.with_row_splits_dtype(
                      input.row_splits.dtype
                  )
              return (
                  input.with_flat_values(normalized_texts),
                  input.with_flat_values(offsets)
                  if get_offsets
                  else None,
              )
  
          (
              normalized_texts,
              offsets,
              row_splits,
          ) = gen_fast_bert_normalizer.fast_bert_normalize(
              input_values=input,
              fast_bert_normalizer_model=self._model,
              get_offsets=get_offsets,
          )
  
          if get_offsets:
              offsets = RaggedTensor.from_row_splits(
                  offsets, row_splits, validate=False
              )
  
          return normalized_texts, offsets
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensorflow.python.eager import monitoring
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.module import module
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor
  from tensorflow_text.core.pybinds import pywrap_fast_bert_normalizer_model_builder
  from tensorflow.python.framework import load_library
  from tensorflow.python.platform import resource_loader
label_desc: Use image node_id 4 for calling the FastBertNormalizer obj's underlying member method code with example usage: obj._normalize_with_offsets_helper(input, get_offsets) and returns: normalized_texts,  offsets, normalized_texts,  unknown, input,  unknown