def _convert_transpose(builder, node, graph, err):
    """
    convert to CoreML Transpose Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3426
    """
    axes = node.attrs.get('perm', [])
    if axes == []:
        rank = builder._get_rank(node.inputs[0])
        if rank == -1:
            return err.unsupported_op_configuration(builder, node, graph,
                'Rank unknown for input')
        axes = list(range(-1, -(rank + 1), -1))
    builder.add_transpose(name=node.name, axes=axes, input_name=node.inputs
        [0], output_name=node.outputs[0])
