Ejemplo n.º 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)
Ejemplo n.º 2
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.
        # 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)
Ejemplo n.º 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)