You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Graph_ir.proto 3.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * Copyright 2019 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. syntax = "proto3";
  17. package mindspore;
  18. // Data type definition
  19. enum DataType {
  20. DT_UNDEFINED = 0;
  21. // Basic types.
  22. DT_BOOL = 1; // bool
  23. DT_INT8 = 2; // int8_t
  24. DT_INT16 = 3; // int16_t
  25. DT_INT32 = 4; // int32_t
  26. DT_INT64 = 5; // int64_t
  27. DT_UINT8 = 6; // uint8_t
  28. DT_UINT16 = 7; // uint16_t
  29. DT_UINT32 = 8; // uint32_t
  30. DT_UINT64 = 9; // uint64_t
  31. DT_FLOAT16 = 10; // float 16
  32. DT_FLOAT32 = 11; // float 32
  33. DT_FLOAT64 = 12; // float 64
  34. DT_STRING = 13; // string
  35. DT_TENSOR = 14; // tensor
  36. DT_GRAPH = 15; // graph
  37. // list type
  38. DT_BOOLS = 16; // list of bool
  39. DT_INTS8 = 17; // list of int8_t
  40. DT_INTS16 = 18; // list of int16_t
  41. DT_INTS32 = 19; // list of int32_t
  42. DT_INTS64 = 20; // list of int64_t
  43. DT_UINTS8 = 21; // list of uint8_t
  44. DT_UINTS16 = 22; // list of uint16_t
  45. DT_UINTS32 = 23; // list of uint32_t
  46. DT_UINTS64 = 24; // list of uint64_t
  47. DT_FLOATS16 = 25; // list of float16
  48. DT_FLOATS32 = 26; // list of float32
  49. DT_FLOATS64 = 27; // list of float64
  50. DT_STRINGS = 28; // list of string
  51. DT_TENSORS = 29; // list of tensor
  52. DT_GRAPHS = 30; // list of graph
  53. DT_TUPLE = 31; // tuple
  54. DT_LIST = 32; // list
  55. DT_DICT = 33; // dictionary
  56. // other types
  57. DT_NONE = 34; // None
  58. DT_SYM_INST = 35; // Symbolic Key Instance
  59. // type related type
  60. DT_BASE_INT = 36; // type generic int
  61. DT_BASE_UINT = 37; // type generate unsigned int
  62. DT_BASE_FLOAT = 38; // type generate float
  63. DT_TYPE = 39; // type type
  64. DT_ANYTHING = 40; // type anything
  65. };
  66. enum MSConst {
  67. DEFAULT_REFCOUNT = 0;
  68. WEIGHT_REFCOUNT = 999;
  69. };
  70. message TensorDef {
  71. DataType data_type = 1;
  72. repeated int64 dims = 2;
  73. string format = 3;
  74. string layout = 4;
  75. uint32 refCount = 5;
  76. uint64 offset = 6;
  77. uint64 size = 7;
  78. uint64 weight_size = 8;
  79. bytes data = 9;
  80. }
  81. message OpDef {
  82. string name = 1;
  83. string type = 2;
  84. string fwk_type = 3;
  85. string opAttr = 4;
  86. repeated int64 input_index = 5;
  87. repeated int64 output_index = 6;
  88. }
  89. message GraphDef {
  90. string name = 1;
  91. repeated int64 input_index = 2;
  92. repeated int64 output_index = 3;
  93. uint64 mempool_size = 4;
  94. repeated OpDef opdefs = 5;
  95. repeated TensorDef alltensors = 6;
  96. }