class_docstr: Allows to create stack layers for a given network.
class_docstr_tok: ["Allows","to","create","stack","layers","for","a","given","network","."]
code: def vectorize_input(input_layer):
      input_shape = input_layer.get_shape()
  
      if input_shape.ndims == 4:
          # Spatial input, must be vectorized.
          dim = 1
          for x in input_shape[1:].as_list():
              dim *= int(x)
  
          # dim = operator.mul(*(input_shape[1:].as_list()))
          vectorized_input = tf.reshape(input_layer, [-1, dim])
      else:
          vectorized_input, dim = (input_layer, input_shape[-1])
  
      return vectorized_input, dim
  
file_path: mtcnn/mtcnn/layer_factory.py
imports: import tensorflow
  from distutils.version import LooseVersion
label_desc: Use image node_id 4 for calling the LayerFactory obj's underlying member method code with example usage: obj.vectorize_input(input_layer) and returns: vectorized_input,  dim