def find_node_input_name(node, name):
    """
    Finds a node input by its name.
    :param node: onnx node
    :param name: node name
    :return: input index
    """
    for i, inode in enumerate(node.input.node):
        if inode.name == name:
            return i
    return -1