code: def flatten(incoming, name="Flatten"):
      """Flatten.
  
      Flatten the incoming Tensor.
  
      Input:
          (2+)-D `Tensor`.
  
      Output:
          2-D `Tensor` [batch, flatten_dims].
  
      Arguments:
          incoming: `Tensor`. The incoming tensor.
  
      """
      input_shape = utils.get_incoming_shape(incoming)
      assert (
          len(input_shape) > 1
      ), "Incoming Tensor shape must be at least 2-D"
      dims = int(np.prod(input_shape[1:]))
      x = reshape(incoming, [-1, dims], name)
  
      # Track output tensor.
      tf.add_to_collection(tf.GraphKeys.LAYER_TENSOR + "/" + name, x)
  
      return x
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import standard_ops
  import tflearn
  from tflearn import utils
  from tflearn import variables
  from tflearn import activations
  from tflearn import initializations
  from tflearn import regularizers
label_desc: Use image node_id 6 for calling a global function with example usage: flatten(incoming, name) and returns: x