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.

op.fbs 5.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. namespace mindspore.predict;
  17. enum ResizeMethod: byte {
  18. UNKNOW = -1,
  19. BILINEAR = 0,
  20. NEAREST_NEIGHBOR = 1
  21. }
  22. enum DataFormatType : byte {
  23. UNKNOW = -1,
  24. NCHW = 0,
  25. NHWC = 1,
  26. HWC = 2, // for input image or resize
  27. CHW = 3, // for input image or resize
  28. }
  29. enum ActivationType : byte {
  30. NO_ACTIVATION = 0,
  31. RELU = 1,
  32. SIGMOID = 2,
  33. RELU6 = 3,
  34. ELU = 4,
  35. LEAKY_RELU = 5,
  36. ABS = 6,
  37. RELU1 = 7,
  38. SOFTSIGN = 8,
  39. SOFTPLUS = 9,
  40. TANH = 10,
  41. UNKNOW = 11
  42. }
  43. enum PoolMode : byte {
  44. MAX_POOLING = 0,
  45. MEAN_POOLING = 1,
  46. GLOBAL_POOING = 2
  47. }
  48. enum EltwiseMode : byte {
  49. PROD = 0,
  50. SUM = 1,
  51. MAXIMUM = 2
  52. }
  53. enum PadMode : byte {
  54. NOTSET=0,
  55. SAME=1,
  56. VALID=2,
  57. CAFFE_CEIL_NEW=4
  58. }
  59. enum PaddingMode : byte {
  60. CONSTANT = 0,
  61. REFLECT = 1,
  62. SYMMETRIC = 2,
  63. MODE_RESERVED = 3
  64. }
  65. table Pad {
  66. paddingmode: PaddingMode;
  67. paddings: [int];
  68. }
  69. table Maximum {
  70. format: DataFormatType = 0;
  71. }
  72. table Concat {
  73. axis: int;
  74. n: int;
  75. }
  76. table SoftMax {
  77. axis: [int];
  78. }
  79. table Activation {
  80. type: ActivationType = 0;
  81. }
  82. table Conv2D {
  83. format: DataFormatType = 0;
  84. group: int;
  85. channelIn: int;
  86. channelOut: int;
  87. kernelW: int;
  88. kernelH: int;
  89. strideW: int;
  90. strideH: int;
  91. padMode: PadMode;
  92. padUp: int;
  93. padDown: int;
  94. padLeft: int;
  95. padRight: int;
  96. dilateW: int;
  97. dilateH: int;
  98. hasBias: bool = false;
  99. activationType: ActivationType = 0;
  100. }
  101. table FusedBatchNorm {
  102. epsilon: float; // eg. epsilon=0.001
  103. }
  104. table CaffeBatchNorm {
  105. epsilon: float; // eg. epsilon=0.001
  106. }
  107. table Squeeze {
  108. axis: [int];
  109. }
  110. table BiasAdd {
  111. axis: [int];
  112. }
  113. table Pooling {
  114. format: DataFormatType = 0;
  115. poolingMode: PoolMode;
  116. windowW: int;
  117. windowH: int;
  118. strideW: int;
  119. strideH: int;
  120. padMode: PadMode;
  121. padUp: int;
  122. padDown: int;
  123. padLeft: int;
  124. padRight: int;
  125. caffeMode: bool = false;
  126. }
  127. table DepthwiseConv2D {
  128. format: DataFormatType = 0;
  129. channelIn: int;
  130. channelMultiplier: int;
  131. kernelW: int;
  132. kernelH: int;
  133. strideW: int;
  134. strideH: int;
  135. padMode: PadMode;
  136. padUp: int;
  137. padDown: int;
  138. padLeft: int;
  139. padRight: int;
  140. dilateW: int;
  141. dilateH: int;
  142. hasBias: bool = false;
  143. activationType: ActivationType = 0;
  144. }
  145. table DeDepthwiseConv2D {
  146. format: DataFormatType = 0;
  147. channelIn: int;
  148. channelMultiplier: int;
  149. kernelW: int;
  150. kernelH: int;
  151. strideW: int;
  152. strideH: int;
  153. padMode: PadMode;
  154. padUp: int;
  155. padDown: int;
  156. padLeft: int;
  157. padRight: int;
  158. dilateW: int;
  159. dilateH: int;
  160. hasBias: bool = false;
  161. activationType: ActivationType = 0;
  162. }
  163. table Resize {
  164. format: DataFormatType = 0;
  165. method: ResizeMethod;
  166. newHeight: long;
  167. newWidth: long;
  168. alignCorners: bool = false;
  169. preserveAspectRatio: bool = false;
  170. }
  171. table DetectionPostProcess {
  172. format: DataFormatType = 0;
  173. inputSize: int;
  174. hScale: float;
  175. wScale: float;
  176. xScale: float;
  177. yScale: float;
  178. NmsIouThreshold: float;
  179. NmsScoreThreshold: float;
  180. MaxDetections: long;
  181. DetectionsPreClass: long;
  182. MaxClassesPreDetection: long;
  183. NumClasses: long;
  184. UseRegularNms: bool;
  185. }
  186. table FullConnection {
  187. format: DataFormatType = 0;
  188. hasBias: bool;
  189. axis: int;
  190. }
  191. // Mean(input_tensor, axis, keep_dims)
  192. table Mean {
  193. axis: [int];
  194. keepDims: bool = false;
  195. }
  196. table DeConv2D {
  197. format: DataFormatType = 0;
  198. group: int;
  199. channelIn: int;
  200. channelOut: int;
  201. kernelW: int;
  202. kernelH: int;
  203. strideW: int;
  204. strideH: int;
  205. padMode: PadMode;
  206. padUp: int;
  207. padDown: int;
  208. padLeft: int;
  209. padRight: int;
  210. dilateW: int;
  211. dilateH: int;
  212. hasBias: bool = false;
  213. activationType: ActivationType = 0;
  214. }
  215. table Scale {
  216. format: DataFormatType = 0;
  217. }
  218. table Eltwise {
  219. format: DataFormatType = 0;
  220. mode: EltwiseMode;
  221. }
  222. table Add {
  223. format: DataFormatType = 0;
  224. }
  225. table Slice {
  226. format: DataFormatType = 0;
  227. begin: [int];
  228. end: [int];
  229. stride: [int];
  230. }
  231. table Mul {
  232. }
  233. table Exp {
  234. }
  235. table Reshape {
  236. format: DataFormatType = 0;
  237. shape: [long];
  238. }
  239. table Power {
  240. power: float;
  241. scale: float;
  242. shift: float;
  243. }
  244. table ArgMax {
  245. axis: int;
  246. outMaxValue: bool;
  247. topK: int;
  248. keepDims: bool;
  249. axisType: int;
  250. }
  251. table NetOutput {
  252. format: DataFormatType = 0;
  253. }
  254. table MatMul {
  255. transposeA : bool = false;
  256. transposeB : bool = false;
  257. }
  258. table CaffePReLU {
  259. channelShared : bool = false;
  260. }
  261. table StridedSlice {
  262. beginMask: int;
  263. endMask: int;
  264. ellipsisMask: int;
  265. newAxisMask: int;
  266. shrinkAxisMask: int;
  267. begin: [int];
  268. end: [int];
  269. stride: [int];
  270. isScale: [int];
  271. }
  272. table Stack {
  273. axis: int;
  274. n: int;
  275. isScale: [int];
  276. }
  277. table Range {
  278. start: int;
  279. limit: int;
  280. delta: int;
  281. }
  282. table ExpandDims {
  283. dim: int;
  284. }
  285. table Tile {
  286. multiples: [int];
  287. }
  288. table Cast {
  289. srcT: int;
  290. dstT: int;
  291. }
  292. table Split {
  293. numberSplit: int;
  294. sizeSplits: [int];
  295. splitDim: int;
  296. }
  297. table CaffeCrop {
  298. axis : long;
  299. offsets : [long];
  300. }
  301. table Permute {
  302. order: [long];
  303. }