示例#1
0
    def compile(self, graph, argspec, outspec):
        """Compile the group of graphs rooted at `graph`.

        This function takes in a fully typed graph cluster rooted at
        `graph` with a manager and must return a callable that accepts
        arguments of the same type and number as the root graph.
        """
        # Remove symbolic key instances.
        graph = convert_grad(graph)
        # Then compile the graph.
        return self.compiler.run(graph, self)
示例#2
0
文件: python.py 项目: notoraptor/myia
    def compile(self, graph, argspec, outspec):
        """Compile the group of graphs rooted at `graph`.

        This function takes in a fully typed graph cluster rooted at
        `graph` with a manager and must return a callable that accepts
        arguments of the same type and number as the root graph.
        """
        # Remove symbolic key instances.
        graph = convert_grad(graph)
        # Then compile the graph.
        # Create a PythonCompiler object each time we want to compile,
        # to avoid sharing states through different compilations
        # (e.g. for "PythonCompiler.globals" member).
        return PythonCompiler().run(graph, self)
示例#3
0
 def compile(self, graph, argspec, outspec):
     """Compiler a graph."""
     make_handle_to_make_cell(graph)
     graph = convert_grad(graph)
     return self.compiler.run(graph, self.context, self.target,
                              self.exec_kind)