Classes | Namespaces | Macros | Typedefs | Functions
pass.h File Reference

Pass that can be applied to a graph. More...

#include <vector>
#include <functional>
#include "base.h"
#include "graph.h"
Include dependency graph for pass.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  nnvm::PassFunctionReg
 Registry entry for pass functions. More...




#define NNVM_REGISTER_PASS(name)   DMLC_REGISTRY_REGISTER(::nnvm::PassFunctionReg, PassFunctionReg, name)
 Macro to register pass fuctions. More...


typedef std::function< Graph(Graph src)> nnvm::PassFunction
 A PassFunction is an "Operator on Graph". It takes a source graph and return a graph that may or may not be the same as the input one. More...


Graph nnvm::ApplyPasses (Graph src, const std::vector< std::string > &passes)
 Apply a series of pass transformations on the input graph. More...
Graph nnvm::ApplyPass (Graph src, const std::string &pass)
 Apply one pass to the graph. More...

Detailed Description

Pass that can be applied to a graph.

Macro Definition Documentation

#define NNVM_REGISTER_PASS (   name)    DMLC_REGISTRY_REGISTER(::nnvm::PassFunctionReg, PassFunctionReg, name)

Macro to register pass fuctions.

1 // example of registering a shape inference pass
3 .describe("Shape Inference function, generate graph attributes")
4 .provide_graph_attr("data_shape")
5 .depend_graph_attr("indexed_graph")
6 .depend_op_attr("infer_shape")
7 .set_body([](const Graph& g) {
8  // shape inference logic
9  });