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.

__init__.py 8.3 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """
  16. Primitive operator classes.
  17. A collection of operators to build nerual networks or computing functions.
  18. """
  19. from .array_ops import (Argmax, Argmin, Cast, Concat, Pack, Unpack,
  20. Diag, DiagPart, DType, ExpandDims, Eye,
  21. Fill, GatherNd, GatherV2, InvertPermutation,
  22. IsInstance, IsSubClass, ArgMaxWithValue, OnesLike, ZerosLike,
  23. Rank, Reshape, ResizeNearestNeighbor, ArgMinWithValue, Range,
  24. SameTypeShape, ScatterAdd, ScatterMax, ScatterUpdate,
  25. ScalarToArray, ScalarToTensor, ScatterNd, ScatterNdUpdate, Select,
  26. Shape, Size, Slice, Split, EmbeddingLookup,
  27. Squeeze, StridedSlice, Tile,
  28. Transpose, TruncatedNormal, TupleToArray, UnsortedSegmentMin,
  29. UnsortedSegmentSum, SpaceToDepth, DepthToSpace, SpaceToBatch, BatchToSpace,
  30. SpaceToBatchND, BatchToSpaceND)
  31. from .comm_ops import (AllGather, AllReduce, _AlltoAll, ReduceScatter, Broadcast,
  32. _MirrorOperator, ReduceOp, _VirtualDataset,
  33. _VirtualDiv, _GetTensorSlice,
  34. HostAllGather, HostReduceScatter)
  35. from .debug_ops import (ImageSummary, InsertGradientOf, HookBackward, ScalarSummary,
  36. TensorSummary, HistogramSummary, Print)
  37. from .control_ops import ControlDepend, GeSwitch, Merge
  38. from .inner_ops import ScalarCast
  39. from .math_ops import (Abs, ACos, Asin, Asinh, AddN, AssignAdd, AssignSub, Atan2, BatchMatMul, BitwiseAnd, BitwiseOr,
  40. BitwiseXor,
  41. ReduceMax, ReduceMin, ReduceMean, ReduceSum, ReduceAll, ReduceProd, CumProd,
  42. Cos, Div, DivNoNan, Equal, EqualCount, Exp, Expm1, Erf, Erfc, Floor, FloorDiv, FloorMod, Ceil,
  43. Acosh, Greater, GreaterEqual, Less, LessEqual, Log, Log1p, LogicalAnd,
  44. LogicalNot, LogicalOr, MatMul, Maximum,
  45. Minimum, Mul, Neg, NMSWithMask, NotEqual,
  46. NPUAllocFloatStatus, NPUClearFloatStatus,
  47. NPUGetFloatStatus, Pow, RealDiv, IsNan, IsInf, IsFinite, FloatStatus,
  48. Reciprocal, CumSum,
  49. Sin, Sqrt, Rsqrt, BesselI0e, BesselI1e,
  50. Square, Sub, TensorAdd, Sign, Round, SquareSumAll, Atan, Atanh, Cosh, Sinh)
  51. from .random_ops import (RandomChoiceWithMask)
  52. from .nn_ops import (LSTM, SGD, Adam, ApplyMomentum, BatchNorm,
  53. BiasAdd, Conv2D,
  54. DepthwiseConv2dNative,
  55. DropoutDoMask, DropoutGrad, Dropout,
  56. DropoutGenMask, Flatten, FusedBatchNorm,
  57. Gelu, Elu,
  58. GetNext, L2Normalize, LayerNorm, L2Loss, CTCLoss,
  59. LogSoftmax,
  60. MaxPool,
  61. AvgPool, Conv2DBackpropInput, ConfusionMulGrad,
  62. MaxPoolWithArgmax, OneHot, Pad, MirrorPad, PReLU, ReLU, ReLU6, ReLUV2, HSwish, HSigmoid,
  63. ResizeBilinear, Sigmoid,
  64. SigmoidCrossEntropyWithLogits,
  65. SmoothL1Loss, Softmax, Softplus,
  66. SoftmaxCrossEntropyWithLogits, ROIAlign,
  67. SparseSoftmaxCrossEntropyWithLogits, Tanh,
  68. TopK, BinaryCrossEntropy, SparseApplyAdagrad, LARSUpdate, ApplyFtrl, SparseApplyFtrl,
  69. ApplyProximalAdagrad, SparseApplyProximalAdagrad,
  70. ApplyRMSProp, ApplyCenteredRMSProp, BasicLSTMCell)
  71. from .other_ops import (Assign, IOU, BoundingBoxDecode, BoundingBoxEncode,
  72. CheckValid, MakeRefKey, CheckBprop, ConfusionMatrix)
  73. from . import _quant_ops
  74. from ._quant_ops import *
  75. from .thor_ops import *
  76. __all__ = [
  77. 'TensorAdd',
  78. 'Argmax',
  79. 'Argmin',
  80. 'ArgMaxWithValue',
  81. 'ArgMinWithValue',
  82. 'AddN',
  83. 'Sub',
  84. 'CumSum',
  85. 'MatMul',
  86. 'BatchMatMul',
  87. 'Mul',
  88. 'Pow',
  89. 'Exp',
  90. 'Expm1',
  91. 'Rsqrt',
  92. 'Sqrt',
  93. 'Square',
  94. 'Conv2D',
  95. 'Flatten',
  96. 'MaxPoolWithArgmax',
  97. 'BatchNorm',
  98. 'MaxPool',
  99. 'TopK',
  100. 'Adam',
  101. 'Softplus',
  102. 'Softmax',
  103. 'LogSoftmax',
  104. 'SoftmaxCrossEntropyWithLogits',
  105. 'ROIAlign',
  106. 'ConfusionMulGrad',
  107. 'SparseSoftmaxCrossEntropyWithLogits',
  108. 'SGD',
  109. 'ApplyMomentum',
  110. 'ExpandDims',
  111. 'Cast',
  112. 'IsSubClass',
  113. 'IsInstance',
  114. 'Reshape',
  115. 'Squeeze',
  116. 'Transpose',
  117. 'OneHot',
  118. 'GatherV2',
  119. 'Concat',
  120. 'Pack',
  121. 'Unpack',
  122. 'Tile',
  123. 'BiasAdd',
  124. 'Gelu',
  125. 'Minimum',
  126. 'Maximum',
  127. 'StridedSlice',
  128. 'ReduceSum',
  129. 'ReduceMean',
  130. 'LayerNorm',
  131. 'EmbeddingLookup',
  132. 'Rank',
  133. 'Less',
  134. 'LessEqual',
  135. 'RealDiv',
  136. 'Div',
  137. 'DivNoNan',
  138. 'TruncatedNormal',
  139. 'Fill',
  140. 'OnesLike',
  141. 'ZerosLike',
  142. 'Select',
  143. 'Split',
  144. 'ReLU',
  145. 'ReLU6',
  146. 'Elu',
  147. 'Erf',
  148. 'Erfc',
  149. 'Sigmoid',
  150. 'HSwish',
  151. 'HSigmoid',
  152. 'Tanh',
  153. 'RandomChoiceWithMask',
  154. 'ResizeBilinear',
  155. 'ScalarSummary',
  156. 'ImageSummary',
  157. 'TensorSummary',
  158. 'HistogramSummary',
  159. "Print",
  160. 'InsertGradientOf',
  161. 'HookBackward',
  162. 'InvertPermutation',
  163. 'Shape',
  164. 'DropoutDoMask',
  165. 'DropoutGenMask',
  166. 'DropoutGrad',
  167. 'Dropout',
  168. 'Neg',
  169. 'Slice',
  170. 'DType',
  171. 'NPUAllocFloatStatus',
  172. 'NPUGetFloatStatus',
  173. 'NPUClearFloatStatus',
  174. 'IsNan',
  175. 'IsFinite',
  176. 'IsInf',
  177. 'FloatStatus',
  178. 'Reciprocal',
  179. 'SmoothL1Loss',
  180. 'L2Loss',
  181. 'CTCLoss',
  182. 'ReduceAll',
  183. 'ScalarToArray',
  184. 'ScalarToTensor',
  185. 'TupleToArray',
  186. 'ControlDepend',
  187. 'GeSwitch',
  188. 'Merge',
  189. 'SameTypeShape',
  190. 'CheckBprop',
  191. 'CheckValid',
  192. 'BoundingBoxEncode',
  193. 'BoundingBoxDecode',
  194. 'L2Normalize',
  195. 'ScatterAdd',
  196. 'ScatterNd',
  197. 'ScatterMax',
  198. 'ResizeNearestNeighbor',
  199. 'Pad',
  200. 'MirrorPad',
  201. 'GatherNd',
  202. 'ScatterUpdate',
  203. 'ScatterNdUpdate',
  204. 'Floor',
  205. 'NMSWithMask',
  206. 'IOU',
  207. 'MakeRefKey',
  208. 'AvgPool',
  209. # Back Primitive
  210. 'Equal',
  211. 'EqualCount',
  212. 'NotEqual',
  213. 'Greater',
  214. 'GreaterEqual',
  215. 'LogicalNot',
  216. 'LogicalAnd',
  217. 'LogicalOr',
  218. 'Size',
  219. 'DepthwiseConv2dNative',
  220. 'UnsortedSegmentSum',
  221. 'UnsortedSegmentMin',
  222. "AllGather",
  223. "HostAllGather",
  224. "AllReduce",
  225. "ReduceScatter",
  226. "HostReduceScatter",
  227. "Broadcast",
  228. "ReduceOp",
  229. 'ScalarCast',
  230. 'GetNext',
  231. 'ReduceMax',
  232. 'ReduceMin',
  233. 'ReduceProd',
  234. 'CumProd',
  235. 'Log',
  236. 'Log1p',
  237. 'SigmoidCrossEntropyWithLogits',
  238. 'FloorDiv',
  239. 'FloorMod',
  240. 'Ceil',
  241. 'Acosh',
  242. 'Asinh',
  243. "PReLU",
  244. "Cos",
  245. "Cosh",
  246. "ACos",
  247. "Diag",
  248. "DiagPart",
  249. 'Eye',
  250. 'Assign',
  251. 'AssignAdd',
  252. 'AssignSub',
  253. "Sin",
  254. "Sinh",
  255. "Asin",
  256. "LSTM",
  257. "Abs",
  258. "BinaryCrossEntropy",
  259. "SparseApplyAdagrad",
  260. "SpaceToDepth",
  261. "DepthToSpace",
  262. "Conv2DBackpropInput",
  263. "Sign",
  264. "LARSUpdate",
  265. "Round",
  266. "ApplyFtrl",
  267. "SpaceToBatch",
  268. "SparseApplyFtrl",
  269. "ApplyProximalAdagrad",
  270. "SparseApplyProximalAdagrad",
  271. "BatchToSpace",
  272. "Atan2",
  273. "ApplyRMSProp",
  274. "ApplyCenteredRMSProp",
  275. "SpaceToBatchND",
  276. "BatchToSpaceND",
  277. "SquareSumAll",
  278. "BitwiseAnd",
  279. "BitwiseOr",
  280. "BitwiseXor",
  281. "BesselI0e",
  282. "BesselI1e",
  283. "Atan",
  284. "Atanh",
  285. "BasicLSTMCell",
  286. "ConfusionMatrix"
  287. ]
  288. __all__.extend(_quant_ops.__all__)
  289. __all__.sort()