momemta::ComputationGraphBuilder Class Reference
#include <Graph.h>
Detailed Description
Builder for the computation graph.
Connections between modules are used as constrains for proper ordering of operations. If a module does not contribute to the graph (it's output is not used and it's not a sticky module), it's ignored and removed from the final graph.
In case it's not possible to build the computation graph (cyclic dependencies for example), an exception is thrown.
- See also
- momemta::ComputationGraph
Public Member Functions | |
ComputationGraphBuilder (const momemta::ModuleList &available_modules, const Configuration &configuration) | |
Create a new builder. More... | |
std::shared_ptr< ComputationGraph > | build () |
Build the computation graph. More... | |
void | exportGraph (const std::string &output) const |
Export a GraphViz representation of the computation graph to a file. More... | |
Constructor & Destructor Documentation
◆ ComputationGraphBuilder()
momemta::ComputationGraphBuilder::ComputationGraphBuilder | ( | const momemta::ModuleList & | available_modules, |
const Configuration & | configuration | ||
) |
Create a new builder.
- Warning
- The configuration may be updated if, after pruning of unused modules, the number of integration dimensions requested have changed.
- Parameters
-
available_modules List of definitions of all the available modules. configuration The configuration to use to build the computation graph. It may be updated if, after pruning of unused modules, the number of integration dimensions requested changed.
Member Function Documentation
◆ build()
std::shared_ptr< ComputationGraph > momemta::ComputationGraphBuilder::build | ( | ) |
Build the computation graph.
An exception is thrown if a graph cannot be build. In such case, a graphviz representation of the graph is automatically dumped into the current working directory into a file named graph.debug
, which may be used to diagnosticate the issue.
- Returns
- A pointer to the computation graph.
◆ exportGraph()
void momemta::ComputationGraphBuilder::exportGraph | ( | const std::string & | output | ) | const |
The documentation for this class was generated from the following files: