code: def flatten_reshape(variable, name="flatten"):
      """Reshapes a high-dimension vector input.
  
      [batch_size, mask_row, mask_col, n_mask] ---> [batch_size, mask_row x mask_col x n_mask]
  
      Parameters
      ----------
      variable : TensorFlow variable or tensor
          The variable or tensor to be flatten.
      name : str
          A unique layer name.
  
      Returns
      -------
      Tensor
          Flatten Tensor
  
      """
      dim = 1
      for d in variable.get_shape()[1:].as_list():
          dim *= d
      return tf.reshape(variable, shape=[-1, dim], name=name)
  
imports: import numpy
  import tensorflow
  from tensorflow.python.ops.rnn_cell import LSTMStateTuple
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated, deprecated_alias
label_desc: Use image node_id 3 for calling a global function with example usage: flatten_reshape(variable, name) and returns: tf