code: def tf_create_attention_map(incoming):
      """
      flatten hight and width into one dimention of size attn_length
      :param incoming: 3D Tensor [batch_size x cur_h x cur_w x num_channels]
      :return: attention_map: 3D Tensor [batch_size x attn_length x attn_size].
      """
      shape = incoming.get_shape().as_list()
      return tf.reshape(incoming, (-1, np.prod(shape[1:3]), shape[3]))
  
file_path: attention-ocr/aocr/model/cnn.py
imports: from __future__ import absolute_import
  import numpy
  import tensorflow
label_desc: Use image node_id 8 for calling a global function with example usage: tf_create_attention_map(incoming) and returns: tf