class_docstr: The class for the computation graph based QA model.
docstr: Build char embedding network for the QA model.
docstr_tok: ["Build","char","embedding","network","for","the","QA","model","."]
code: def build_char_states(
      self, char_embed, is_training, reuse, char_ids, char_lengths
  ):
      """Build char embedding network for the QA model."""
      max_char_length = self.cfg.max_char_length
  
      inputs = dropout(
          tf.nn.embedding_lookup(char_embed, char_ids),
          self.cfg.dropout,
          is_training,
      )
      inputs = tf.reshape(
          inputs, shape=[max_char_length, -1, self.cfg.char_embed_dim]
      )
      char_lengths = tf.reshape(char_lengths, shape=[-1])
      with tf.variable_scope("char_encoding", reuse=reuse):
          cell_fw = XGRUCell(hidden_dim=self.cfg.char_embed_dim)
          cell_bw = XGRUCell(hidden_dim=self.cfg.char_embed_dim)
          _, (left_right, right_left) = tf.nn.bidirectional_dynamic_rnn(
              cell_fw=cell_fw,
              cell_bw=cell_bw,
              sequence_length=char_lengths,
              inputs=inputs,
              time_major=True,
              dtype=tf.float32,
          )
  
      left_right = tf.reshape(
          left_right, shape=[-1, self.cfg.char_embed_dim]
      )
  
      right_left = tf.reshape(
          right_left, shape=[-1, self.cfg.char_embed_dim]
      )
  
      states = tf.concat([left_right, right_left], axis=1)
      out_shape = tf.shape(char_ids)[1:3]
      out_shape = tf.concat(
          [
              out_shape,
              tf.constant(
                  value=[self.cfg.char_embed_dim * 2], dtype=tf.int32
              ),
          ],
          axis=0,
      )
      return tf.reshape(states, shape=out_shape)
  
file_path: nni/examples/trials/weight_sharing/ga_squad/train_model.py
imports: import tensorflow
  from attention import DotAttention
  from rnn import XGRUCell
  from util import dropout
  from graph_to_tf import graph_to_network
label_desc: Use image node_id 3 for calling the GAG obj's underlying member method code with example usage: obj.build_char_states(char_embed, is_training, reuse, char_ids, char_lengths) and returns: tf