1 #ifndef LITE_NNRT_NNRT_LITE_GRAPH_H 2 #define LITE_NNRT_NNRT_LITE_GRAPH_H 3 #include <memory> 4 #include <string> 5 #include <vector> 6 namespace mindspore { 7 namespace lite { 8 9 typedef void *PrimitivePtr; 10 typedef const void *ConstPrimitivePtr; 11 12 typedef void *TensorPtr; 13 typedef const void *ConstTensorPtr; 14 15 struct LiteGraph { 16 struct Node { 17 std::string name_; 18 std::string op_type_; // hnn no use 19 int node_type_; // hnn no use 20 PrimitivePtr primitive_ = nullptr; 21 std::shared_ptr<void> base_operator_ = nullptr; // hnn no use 22 std::vector<uint32_t> input_indices_; 23 std::vector<uint32_t> output_indices_; 24 int quant_type_; 25 int device_type_ = -1; // hnn no use 26 }; 27 28 struct SubGraph { 29 std::string name_; 30 std::vector<uint32_t> input_indices_; 31 std::vector<uint32_t> output_indices_; 32 std::vector<uint32_t> node_indices_; 33 std::vector<uint32_t> tensor_indices_; // hnn no use 34 }; 35 36 std::string name_; 37 std::string version_; // hnn no use 38 std::vector<uint32_t> input_indices_; 39 std::vector<uint32_t> output_indices_; 40 std::vector<TensorPtr> all_tensors_; 41 std::vector<Node *> all_nodes_; 42 std::vector<SubGraph *> sub_graphs_; 43 #ifdef ENABLE_MODEL_OBF 44 std::vector<uint32_t> all_prims_type_; // hnn no use 45 std::vector<uint32_t> all_nodes_stat_; // hnn no use 46 bool model_obfuscated_ = false; // hnn no use 47 std::vector<unsigned char *> deobf_prims_; // hnn no use 48 #endif 49 }; 50 51 void MindIR_LiteGraph_Destroy(LiteGraph **lite_graph); 52 size_t MindIR_LiteGraph_GetConstTensorSize(const LiteGraph *lite_graph); 53 54 } // namespace lite 55 } // namespace mindspore 56 57 #endif // LITE_NNRT_NNRT_LITE_GRAPH_H 58