Beispiel #1
0
                        "--output-node-names",
                        nargs='+',
                        help="Names of the output nodes")
    parser.add_argument("-t",
                        "--templates",
                        nargs='+',
                        help="List of paths for the Jinja2 templates")
    parser.add_argument(
        "-d",
        "--output-directories",
        nargs='+',
        help="Paths of the output directories for the generated files")
    args = parser.parse_args()

    for model_file in args.frozen_model_filenames:
        # Create a Graph object from the default
        graph = _load_graph(model_file)

        # Cut the graph to only include the nodes between the declared input and the output nodes
        ir = IRGraph(graph,
                     args.input_node_names,
                     args.output_node_names,
                     prefix=GRAPH_OP_PREFIX)

        generator = CodeGenerator(ir)
        generator.generate_template(LIB_CC_FILE_NAME, LIB_H_FILE_NAME,
                                    args.templates, args.output_directories)

    print "Code generated for %s in %s" % (args.frozen_model_filenames,
                                           args.output_directories)