Tenncor
optimize.hpp
Go to the documentation of this file.
1 
9 #include "opt/matcher.hpp"
10 #include "opt/iconverter.hpp"
11 
12 #ifndef OPT_OPTIMIZE_HPP
13 #define OPT_OPTIMIZE_HPP
14 
15 namespace opt
16 {
17 
20 using CstConvertF = std::function<teq::TensptrT(teq::iTensor*)>;
21 
23 struct OptCtx
24 {
27 
30 
32  std::unordered_map<std::string,ConvptrT> converts_;
33 };
34 
39 teq::TensptrsT optimize (teq::TensptrsT roots, const OptCtx& opts);
40 
41 }
42 
43 #endif // OPT_OPTIMIZE_HPP
CstConvertF const_conv_
Function for identifying constant tensors.
Definition: optimize.hpp:29
Definition: candidate.hpp:19
teq::TensptrsT optimize(teq::TensptrsT roots, const OptCtx &opts)
Encapsulation of all conversion rules.
Definition: optimize.hpp:23
VoterPool voters_
Voters for identifying subgraphs associated with conversion target ids.
Definition: optimize.hpp:26
std::function< teq::TensptrT(teq::iTensor *)> CstConvertF
Definition: optimize.hpp:20
std::vector< TensptrT > TensptrsT
Vector of tensor smart pointers.
Definition: itensor.hpp:60
std::unordered_map< std::string, ConvptrT > converts_
Map of conversion target ids to conversion target builders.
Definition: optimize.hpp:32
Parsed representation of a rule tree.
Definition: ivoter.hpp:250