class_docstr: GTN CTC module.
docstr: Build gtn graph.
  
  :param list target: single target sequence
  :param int blank_idx: index of blank token
  :return: gtn graph of target sequence
  :rtype: gtn.Graph
docstr_tok: ["Build","gtn","graph",".",":","param","list","target",":","single","target","sequence",":","param","int","blank_idx",":","index","of","blank","token",":","return",":","gtn","graph","of","target","sequence",":","rtype",":","gtn.Graph"]
code: def create_ctc_graph(target, blank_idx):
      """Build gtn graph.
  
      :param list target: single target sequence
      :param int blank_idx: index of blank token
      :return: gtn graph of target sequence
      :rtype: gtn.Graph
      """
      g_criterion = gtn.Graph(False)
      L = len(target)
      S = 2 * L + 1
      for s in range(S):
          idx = (s - 1) // 2
          g_criterion.add_node(s == 0, s == S - 1 or s == S - 2)
          label = target[idx] if s % 2 else blank_idx
          g_criterion.add_arc(s, s, label)
          if s > 0:
              g_criterion.add_arc(s - 1, s, label)
          if s % 2 and s > 1 and label != target[idx - 1]:
              g_criterion.add_arc(s - 2, s, label)
      g_criterion.arc_sort(False)
      return g_criterion
  
imports: import gtn
  import torch
label_desc: Use image node_id 1 for calling the GTNCTCLossFunction obj's underlying member method code with example usage: obj.create_ctc_graph(target, blank_idx) and returns: g_criterion