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 7.1 kB

6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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,
  24. SameTypeShape,
  25. ScalarToArray, ScalarToTensor, ScatterNd, ScatterNdUpdate, Select,
  26. Shape, Size, Slice, Split,
  27. Squeeze, StridedSlice, Tile,
  28. Transpose, TruncatedNormal, TupleToArray,
  29. UnsortedSegmentSum, SpaceToDepth, DepthToSpace, SpaceToBatch, BatchToSpace)
  30. from .comm_ops import (AllGather, AllReduce, _AlltoAll, ReduceScatter, Broadcast,
  31. _MirrorOperator, ReduceOp, _VirtualDataset,
  32. _VirtualDiv, _GetTensorSlice)
  33. from .debug_ops import (ImageSummary, InsertGradientOf, ScalarSummary,
  34. TensorSummary, HistogramSummary, Print)
  35. from .control_ops import ControlDepend, GeSwitch, Merge
  36. from .inner_ops import ScalarCast
  37. from .math_ops import (Abs, ACos, AddN, AssignAdd, AssignSub, Atan2, BatchMatMul,
  38. ReduceMax, ReduceMin, ReduceMean, ReduceSum, ReduceAll, ReduceProd, CumProd,
  39. Cos, Div, Equal, EqualCount, Exp, Erf, Floor, FloorDiv, FloorMod, Acosh,
  40. Greater, GreaterEqual, Less, LessEqual, Log, LogicalAnd,
  41. LogicalNot, LogicalOr, MatMul, Maximum,
  42. Minimum, Mul, Neg, NMSWithMask, NotEqual,
  43. NPUAllocFloatStatus, NPUClearFloatStatus,
  44. NPUGetFloatStatus, Pow, RealDiv, IsNan, IsInf, IsFinite, FloatStatus,
  45. Reciprocal, CumSum,
  46. Sin, Sqrt, Rsqrt,
  47. Square, Sub, TensorAdd, Sign, Round)
  48. from .random_ops import (RandomChoiceWithMask)
  49. from .nn_ops import (LSTM, SGD, Adam, ApplyMomentum, BatchNorm,
  50. BiasAdd, Conv2D,
  51. DepthwiseConv2dNative,
  52. DropoutDoMask,
  53. DropoutGenMask, Flatten, FusedBatchNorm,
  54. Gelu, Elu,
  55. GetNext, L2Normalize, LayerNorm, L2Loss,
  56. LogSoftmax,
  57. MaxPool, ExtractImagePatches,
  58. AvgPool, Conv2DBackpropInput, ConfusionMulGrad,
  59. MaxPoolWithArgmax, OneHot, Pad, MirrorPad, PReLU, ReLU, ReLU6, ReLUV2, HSwish, HSigmoid,
  60. ResizeBilinear, Sigmoid,
  61. SigmoidCrossEntropyWithLogits,
  62. SmoothL1Loss, Softmax,
  63. SoftmaxCrossEntropyWithLogits, ROIAlign,
  64. SparseSoftmaxCrossEntropyWithLogits, Tanh,
  65. TopK, BinaryCrossEntropy, SparseApplyAdagrad, LARSUpdate, ApplyFtrl,
  66. ApplyRMSProp, ApplyCenteredRMSProp)
  67. from .other_ops import Assign, IOU, BoundingBoxDecode, BoundingBoxEncode, CheckValid, MakeRefKey, CheckBprop
  68. from . import _quant_ops
  69. from ._quant_ops import *
  70. __all__ = [
  71. 'TensorAdd',
  72. 'Argmax',
  73. 'Argmin',
  74. 'ArgMaxWithValue',
  75. 'ArgMinWithValue',
  76. 'AddN',
  77. 'Sub',
  78. 'CumSum',
  79. 'MatMul',
  80. 'BatchMatMul',
  81. 'Mul',
  82. 'Pow',
  83. 'Exp',
  84. 'Rsqrt',
  85. 'Sqrt',
  86. 'Square',
  87. 'Conv2D',
  88. 'ExtractImagePatches',
  89. 'Flatten',
  90. 'MaxPoolWithArgmax',
  91. 'FusedBatchNorm',
  92. 'BatchNorm',
  93. 'MaxPool',
  94. 'TopK',
  95. 'Adam',
  96. 'Softmax',
  97. 'LogSoftmax',
  98. 'SoftmaxCrossEntropyWithLogits',
  99. 'ROIAlign',
  100. 'ConfusionMulGrad',
  101. 'SparseSoftmaxCrossEntropyWithLogits',
  102. 'SGD',
  103. 'ApplyMomentum',
  104. 'ExpandDims',
  105. 'Cast',
  106. 'IsSubClass',
  107. 'IsInstance',
  108. 'Reshape',
  109. 'Squeeze',
  110. 'Transpose',
  111. 'OneHot',
  112. 'GatherV2',
  113. 'Concat',
  114. 'Pack',
  115. 'Unpack',
  116. 'Tile',
  117. 'BiasAdd',
  118. 'Gelu',
  119. 'Minimum',
  120. 'Maximum',
  121. 'StridedSlice',
  122. 'ReduceSum',
  123. 'ReduceMean',
  124. 'LayerNorm',
  125. 'Rank',
  126. 'Less',
  127. 'LessEqual',
  128. 'RealDiv',
  129. 'Div',
  130. 'TruncatedNormal',
  131. 'Fill',
  132. 'OnesLike',
  133. 'ZerosLike',
  134. 'Select',
  135. 'Split',
  136. 'ReLU',
  137. 'ReLU6',
  138. 'ReLUV2',
  139. 'Elu',
  140. 'Erf',
  141. 'Sigmoid',
  142. 'HSwish',
  143. 'HSigmoid',
  144. 'Tanh',
  145. 'RandomChoiceWithMask',
  146. 'ResizeBilinear',
  147. 'ScalarSummary',
  148. 'ImageSummary',
  149. 'TensorSummary',
  150. 'HistogramSummary',
  151. "Print",
  152. 'InsertGradientOf',
  153. 'InvertPermutation',
  154. 'Shape',
  155. 'DropoutDoMask',
  156. 'DropoutGenMask',
  157. 'Neg',
  158. 'Slice',
  159. 'DType',
  160. 'NPUAllocFloatStatus',
  161. 'NPUGetFloatStatus',
  162. 'NPUClearFloatStatus',
  163. 'IsNan',
  164. 'IsFinite',
  165. 'IsInf',
  166. 'FloatStatus',
  167. 'Reciprocal',
  168. 'SmoothL1Loss',
  169. 'L2Loss',
  170. 'ReduceAll',
  171. 'ScalarToArray',
  172. 'ScalarToTensor',
  173. 'TupleToArray',
  174. 'ControlDepend',
  175. 'GeSwitch',
  176. 'Merge',
  177. 'SameTypeShape',
  178. 'CheckBprop',
  179. 'CheckValid',
  180. 'BoundingBoxEncode',
  181. 'BoundingBoxDecode',
  182. 'L2Normalize',
  183. 'ScatterNd',
  184. 'ResizeNearestNeighbor',
  185. 'Pad',
  186. 'MirrorPad',
  187. 'GatherNd',
  188. 'ScatterNdUpdate',
  189. 'Floor',
  190. 'NMSWithMask',
  191. 'IOU',
  192. 'MakeRefKey',
  193. 'AvgPool',
  194. # Back Primitive
  195. 'Equal',
  196. 'EqualCount',
  197. 'NotEqual',
  198. 'Greater',
  199. 'GreaterEqual',
  200. 'LogicalNot',
  201. 'LogicalAnd',
  202. 'LogicalOr',
  203. 'Size',
  204. 'DepthwiseConv2dNative',
  205. 'UnsortedSegmentSum',
  206. "AllGather",
  207. "AllReduce",
  208. "ReduceScatter",
  209. "Broadcast",
  210. "ReduceOp",
  211. 'ScalarCast',
  212. 'GetNext',
  213. 'ReduceMax',
  214. 'ReduceMin',
  215. 'ReduceProd',
  216. 'CumProd',
  217. 'Log',
  218. 'SigmoidCrossEntropyWithLogits',
  219. 'FloorDiv',
  220. 'FloorMod',
  221. 'Acosh',
  222. "PReLU",
  223. "Cos",
  224. "ACos",
  225. "Diag",
  226. "DiagPart",
  227. 'Eye',
  228. 'Assign',
  229. 'AssignAdd',
  230. 'AssignSub',
  231. "Sin",
  232. "LSTM",
  233. "Abs",
  234. "BinaryCrossEntropy",
  235. "SparseApplyAdagrad",
  236. "SpaceToDepth",
  237. "DepthToSpace",
  238. "Conv2DBackpropInput",
  239. "Sign",
  240. "LARSUpdate",
  241. "Round",
  242. "ApplyFtrl",
  243. "SpaceToBatch",
  244. "BatchToSpace",
  245. "Atan2",
  246. "ApplyRMSProp",
  247. "ApplyCenteredRMSProp"
  248. ]
  249. __all__.extend(_quant_ops.__all__)
  250. __all__.sort()