20 #include "ATen/core/interned_strings.h" 21 #include "torch/csrc/jit/ir/ir.h" 22 #include "torch/script.h" 24 #include "plugin_create.h" 31 torch::jit::Graph* graph = NULL;
32 torch::jit::Node* node = NULL;
35 typedef uint64_t EngineID;
37 class IEngine :
public IPlugin,
public torch::CustomClassHolder {
46 virtual int init() = 0;
54 virtual int transform(
const PorosGraph& sub_graph) = 0;
61 virtual std::vector<at::Tensor>
62 excute_engine(
const std::vector<at::Tensor>& inputs) = 0;
64 virtual void register_module_attribute(
const std::string& name,
65 torch::jit::Module& module) = 0;
68 virtual const std::string who_am_i() = 0;
71 bool is_node_supported(
const torch::jit::Node* node);
74 std::pair<uint64_t, uint64_t> _num_io;