class_docstr: Labels each token in a sequence as belonging to 1 of N token classes.
  
  :param config: A :py:class:`finetune.config.Settings` object or None (for default config).
  :param \**kwargs: key-value pairs of config items to override.
class_docstr_tok: ["Labels","each","token","in","a","sequence","as","belonging","to","1","of","N","token","classes",".",":","param","config",":","A",":","py",":","class",":","`","finetune.config.Settings","`","object","or","None","(","for","default","config",")",".",":","param","\\","*","*","kwargs",":","key-value","pairs","of","config","items","to","override","."]
code: def _predict_op(self, logits, **kwargs):
      trans_mats = kwargs.get("transition_matrix")
      sequence_length = kwargs.get("sequence_length")
      if self.config.use_gpu_crf_predict.lower() == "auto":
          use_gpu_op = self.multi_label
      else:
          use_gpu_op = self.config.use_gpu_crf_predict
  
      if self.multi_label:
          logits = tf.unstack(logits, axis=-1)
          label_idxs = []
          label_probas = []
          for logits_i, trans_mat_i in zip(logits, trans_mats):
              idx, prob = sequence_decode(
                  logits_i,
                  trans_mat_i,
                  sequence_length,
                  use_gpu_op=True,
                  use_crf=self.config.crf_sequence_labeling,
              )
              label_idxs.append(idx)
              label_probas.append(prob[:, :, 1:])
          label_idxs = tf.stack(label_idxs, axis=-1)
          label_probas = tf.stack(label_probas, axis=-1)
      else:
          label_idxs, label_probas = sequence_decode(
              logits,
              trans_mats,
              sequence_length,
              use_gpu_op=False,
              use_crf=self.config.crf_sequence_labeling,
          )
      return label_idxs, label_probas
  
imports: import copy
  import os
  from collections import Counter, defaultdict
  import math
  from typing import Dict, List, Tuple, Union
  import tensorflow
  import numpy
  from finetune.base import BaseModel
  from finetune.encoding.target_encoders import SequenceLabelingEncoder, SequenceMultiLabelingEncoder
  from finetune.nn.target_blocks import sequence_labeler
  from finetune.nn.crf import sequence_decode
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
  from finetune.encoding.input_encoder import get_spacy
  from finetune.input_pipeline import BasePipeline
  from finetune.util.metrics import sequences_overlap
  from finetune.encoding.input_encoder import tokenize_context
label_desc: Use image node_id 13 for calling the SequenceLabeler obj's underlying member method code with example usage: obj._predict_op(logits) and returns: label_idxs,  label_probas