code: def conv_pool(
      embedded_chars_expanded,
      filter_sizes,
      embedding_size,
      num_filters,
      sequence_length,
  ):
      """
      text conv and max pooling to get one-dimension vector to representation of text
      :param filter_sizes:
      :return:
      """
      pooled_outputs = []
      for _, filter_size in enumerate(filter_sizes):
          with tf.variable_scope("conv-maxpool-%s" % filter_size):
              # Convolution Layer
              filter_shape = [
                  filter_size,
                  embedding_size,
                  1,
                  num_filters,
              ]
              W = tf.get_variable(
                  name="W",
                  initializer=tf.truncated_normal(
                      filter_shape, stddev=0.1
                  ),
              )
              b = tf.get_variable(
                  name="b",
                  initializer=tf.constant(0.1, shape=[num_filters]),
              )
              conv = tf.nn.conv2d(
                  embedded_chars_expanded,
                  W,
                  strides=[1, 1, 1, 1],
                  padding="VALID",
                  name="conv",
              )
              # Apply nonlinearity
              h = tf.nn.relu(tf.nn.bias_add(conv, b), name="relu")
              # Maxpooling over the outputs
              pooled = tf.nn.max_pool(
                  h,
                  ksize=[1, sequence_length - filter_size + 1, 1, 1],
                  strides=[1, 1, 1, 1],
                  padding="VALID",
                  name="pool",
              )
              pooled_outputs.append(pooled)
      # Combine all the pooled features
      num_filters_total = num_filters * len(filter_sizes)
  
      h_pool = tf.concat(pooled_outputs, 3)
  
      h_pool_flat = tf.reshape(h_pool, [-1, num_filters_total])
      return h_pool_flat
  
file_path: delta/delta/layers/common_layers.py
imports: import delta.compat
  from absl import logging
  from delta.data.feat import speech_ops
label_desc: Use image node_id 8 for calling a global function with example usage: conv_pool(embedded_chars_expanded, filter_sizes, embedding_size, num_filters, sequence_length) and returns: h_pool_flat