def _convert_flatten(builder, node, graph, err):
    """
    convert to CoreML Flatten Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4826
    """
    axis = node.attrs.get('axis', 1)
    builder.add_flatten_to_2d(name=node.name, input_name=node.inputs[0],
        output_name=node.outputs[0], axis=axis)
