Exemple #1
0
int main()
{
    GOOGLE_PROTOBUF_VERIFY_VERSION;
    onnx::ModelProto modelProto;
    std::fstream input("alexnet.proto", std::ios::in | std::ios::binary);
    if (!parseBigMessageFromIstream(&modelProto, &input)) {
        std::cerr << "Failed to parse model." << std::endl;
        return -1;
    }

    printModelInfo(modelProto);
    const onnx::GraphProto graph = modelProto.graph();
    printGraphInfo(graph);
    printNodeInfo(graph.node(0));

    return 0;
}
Exemple #2
0
//! solve a node, finding it by name
//! @param[in] nameNode    name of the node
void AOgraph::solveByName(string nameNode)
{
    AOnode* solved = findByName(nameNode);
    bool result = solved->setSolved();
    updateNodeFeasibility();
    printGraphInfo();
    
    // report that the graph has been solved if the solved node is the head node
    if (head->nSolved == true)
    {
        cout<<"[REPORT] The graph is solved (head node solved)." <<endl;
        return;
    }
    
    // update the path information (cost) of all paths
    if (result == true)
        updatePaths(*solved);
    cout<<endl <<"Updated paths: " <<endl;
    for(int i=0; i< (int)pUpdate.size(); i++)
        cout<<"Path index: " <<pIndices[i] <<" - Benefit: " <<pUpdate[i] <<endl;
}