InfiniTensor/include/core/mutator.h

36 lines
864 B
C
Raw Permalink Normal View History

2022-08-08 15:52:07 +08:00
#pragma once
#include "core/graph.h"
namespace infini {
class Mutator {
2022-08-09 14:58:45 +08:00
private:
int candidatesLimit;
// // Statistical data
// int numTotalCandidates;
protected:
Runtime runtime;
2022-08-09 14:58:45 +08:00
2022-08-08 15:52:07 +08:00
public:
Mutator(int candidatesLimit,
Runtime runtime = NativeCpuRuntimeObj::getInstance())
: candidatesLimit(candidatesLimit), runtime(runtime){};
2022-08-08 15:52:07 +08:00
virtual ~Mutator(){};
virtual vector<Graph> run(const Graph &in_graph) = 0;
/**
* @brief Merge a multi-branch graph into single branch graphs
*
* @param in_graph
* @return vector<Graph> Transformed graphs except the orignal one.
*/
virtual vector<Graph> mergeMultiBranch(const Graph &in_graph) {
IT_TODO_HALT();
}
virtual bool isMultiBranchMergable(const Graph &in_graph) {
IT_TODO_HALT();
}
2022-08-08 15:52:07 +08:00
};
2022-08-09 14:58:45 +08:00
} // namespace infini