1syntax = "proto2"; 2package mind_ir; 3 4message AttributeProto { 5 enum AttributeType { 6 UNDEFINED = 0; 7 FLOAT = 1; 8 UINT8 = 2; 9 INT8 = 3; 10 UINT16 = 4; 11 INT16 = 5; 12 INT32 = 6; 13 INT64 = 7; 14 STRING = 8; 15 BOOL = 9; 16 FLOAT16 = 10; 17 DOUBLE = 11; 18 UINT32 = 12; 19 UINT64 = 13; 20 COMPLEX64 = 14; 21 COMPLEX128 = 15; 22 BFLOAT16 = 16; 23 TENSOR = 17; 24 GRAPH = 18; 25 TENSORS = 19; 26 TUPLE = 20; // tuple 27 LIST = 21; // list 28 DICT = 22; // dictionary 29 } 30 optional string name = 1; 31 optional float f = 2; 32 optional int64 i = 3; 33 optional double d = 4; 34 optional bytes s = 5; 35 optional TensorProto t = 6; 36 optional GraphProto g = 7; 37 repeated float floats = 8; 38 repeated double doubles = 9; 39 repeated int64 ints = 10; 40 repeated bytes strings = 11; 41 repeated TensorProto tensors = 12; 42 repeated GraphProto graphs = 13; 43 optional string doc_string = 14; 44 optional string ref_attr_name = 15; 45 optional AttributeType type = 16; 46 repeated AttributeProto values = 17; // tuple, list,dict of value 47 optional AttributeType type_val = 18; // type type info 48} 49 50 51message ValueInfoProto { 52 optional string name = 1; 53 repeated TensorProto tensor = 2; 54 optional string doc_string = 3; 55 optional string denotation = 4; 56} 57 58 59message NodeProto { 60 repeated string input = 1; 61 repeated string output = 2; 62 optional string name = 3; 63 optional string op_type = 4; 64 repeated AttributeProto attribute = 5; 65 optional string doc_string = 6; 66 optional string domain = 7; 67} 68 69 70message ModelProto { 71 optional string ir_version = 1; 72 optional string producer_name = 2; 73 optional string producer_version = 3; 74 optional string domain = 4; 75 optional string model_version = 5; 76 optional string doc_string = 6; 77 optional GraphProto graph = 7; 78 repeated GraphProto functions = 8; // all the graphs without the main graph. 79 optional string preprocessor = 9; // data graph from MindData. 80} 81 82 83message GraphProto { 84 repeated NodeProto node = 1; 85 optional string name = 2; 86 repeated TensorProto parameter = 3; 87 optional string doc_string = 4; 88 repeated ValueInfoProto input = 5; 89 repeated ValueInfoProto output = 6; 90 optional string bprop_hash = 7; 91} 92 93 94message TensorProto { 95 enum DataType { 96 UNDEFINED = 0; 97 // Basic types. 98 FLOAT = 1; // float 99 UINT8 = 2; // uint8_t 100 INT8 = 3; // int8_t 101 UINT16 = 4; // uint16_t 102 INT16 = 5; // int16_t 103 INT32 = 6; // int32_t 104 INT64 = 7; // int64_t 105 STRING = 8; // string 106 BOOL = 9; // bool 107 FLOAT16 = 10; 108 DOUBLE = 11; 109 UINT32 = 12; 110 UINT64 = 13; 111 COMPLEX64 = 14; 112 COMPLEX128 = 15; 113 BFLOAT16 = 16; 114 FLOAT64 = 17; 115 } 116 repeated int64 dims = 1; 117 optional int32 data_type = 2; 118 repeated float float_data = 3; 119 repeated int32 int32_data = 4; 120 repeated bytes string_data = 5; 121 repeated int64 int64_data = 6; 122 optional string name = 7; 123 optional string doc_string = 8; 124 optional bytes raw_data = 9; 125 repeated double double_data = 10; 126 repeated uint64 uint64_data = 11; 127} 128