code: def flatten_layer(layer):
      layer_shape = layer.get_shape()
      num_feature = layer_shape[1:4].num_elements()
      layer_flat = tf.reshape(layer, [-1, num_feature])
      return layer_flat, num_feature
  
imports: import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: flatten_layer(layer) and returns: layer_flat,  num_feature