def node_inputs_in_expected_order(model):
    """Verifies that the node inputs are ordered in the way that FINN expects
    them. When a node has a mixture of static (= constant, initialized) inputs
    and dynamic inputs, the dynamic input should come first, followed by the
    static one. Only verifiable for a small subset of op_types for now.

    Returns {"node_inputs_in_expected_order": Bool}."""
    op_types = ["MatMul", "Conv", "Add", "Mul"]
    nodes = filter(lambda x: x.op_type in op_types, model.graph.node)
    all_OK = True
    for n in nodes:
        all_OK = all_OK and len(list(n.input)) == 2
        # input 0 should be dynamic, no initializer
        all_OK = all_OK and (model.get_initializer(n.input[0]) is None)
        # input 1 should be static (unless eltwise add)
        if n.op_type != "Add":
            all_OK = all_OK and (model.get_initializer(n.input[1]) is not None)
    return {"node_inputs_in_expected_order": all_OK}