mindspore 2.0.0rc1__cp38-none-any.whl → 2.2.0__cp38-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mindspore might be problematic. Click here for more details.

Files changed (870) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/Third_Party_Open_Source_Software_Notice +2 -2
  3. mindspore/__init__.py +5 -2
  4. mindspore/_akg/akg/build_module.py +5 -6
  5. mindspore/_akg/akg/composite/build_module.py +49 -16
  6. mindspore/_akg/akg/composite/split_stitch.py +10 -11
  7. mindspore/_akg/akg/config/repository.json +195 -0
  8. mindspore/_akg/akg/global_configs.py +5 -1
  9. mindspore/_akg/akg/ms/info_version_adapt.py +67 -1
  10. mindspore/_akg/akg/tvm/api.py +4 -3
  11. mindspore/_akg/akg/tvm/autotvm/__init__.py +1 -2
  12. mindspore/_akg/akg/tvm/autotvm/graph_tuner/base_graph_tuner.py +1 -5
  13. mindspore/_akg/akg/tvm/autotvm/measure/__init__.py +1 -1
  14. mindspore/_akg/akg/tvm/autotvm/measure/measure.py +1 -10
  15. mindspore/_akg/akg/tvm/autotvm/measure/measure_methods.py +1 -372
  16. mindspore/_akg/akg/tvm/build_module.py +16 -1
  17. mindspore/_akg/akg/tvm/contrib/graph_runtime.py +0 -53
  18. mindspore/_akg/akg/tvm/hybrid/parser.py +7 -6
  19. mindspore/_akg/akg/tvm/ir_builder.py +1 -1
  20. mindspore/_akg/akg/tvm/module.py +1 -2
  21. mindspore/_akg/akg/tvm/stmt.py +2 -2
  22. mindspore/_akg/akg/utils/composite_op_helper.py +9 -10
  23. mindspore/_akg/akg/utils/kernel_exec.py +58 -260
  24. mindspore/_akg/akg/utils/op_dsl.py +17 -1
  25. mindspore/_akg/akg/utils/result_analysis.py +4 -24
  26. mindspore/_akg/akg/utils/tbe_codegen_utils.py +198 -0
  27. mindspore/_c_dataengine.cpython-38-aarch64-linux-gnu.so +0 -0
  28. mindspore/_c_expression.cpython-38-aarch64-linux-gnu.so +0 -0
  29. mindspore/_c_mindrecord.cpython-38-aarch64-linux-gnu.so +0 -0
  30. mindspore/_check_jit_forbidden_api.py +5 -1
  31. mindspore/_checkparam.py +79 -62
  32. mindspore/_extends/graph_kernel/__init__.py +0 -1
  33. mindspore/_extends/graph_kernel/model/graph_split.py +2 -0
  34. mindspore/_extends/graph_kernel/model/model_builder.py +9 -50
  35. mindspore/_extends/graph_kernel/splitter.py +1 -9
  36. mindspore/_extends/parallel_compile/akg_compiler/akg_process.py +128 -21
  37. mindspore/_extends/parallel_compile/akg_compiler/build_tbe_kernel.py +2 -2
  38. mindspore/_extends/parallel_compile/akg_compiler/tbe_topi.py +4 -2
  39. mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py +18 -13
  40. mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +13 -9
  41. mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py +1 -1
  42. mindspore/_extends/parallel_compile/tbe_compiler/tbe_job_manager.py +1 -1
  43. mindspore/_extends/parse/__init__.py +19 -17
  44. mindspore/_extends/parse/namespace.py +7 -36
  45. mindspore/_extends/parse/parser.py +375 -189
  46. mindspore/_extends/parse/resources.py +36 -41
  47. mindspore/_extends/parse/standard_method.py +350 -245
  48. mindspore/_extends/parse/trope.py +2 -12
  49. mindspore/_extends/remote/kernel_build_server.py +24 -7
  50. mindspore/_extends/remote/kernel_build_server_akg_v2.py +55 -0
  51. mindspore/_install_custom.py +43 -0
  52. mindspore/_mindspore_offline_debug.cpython-38-aarch64-linux-gnu.so +0 -0
  53. mindspore/amp.py +85 -19
  54. mindspore/bin/cache_admin +0 -0
  55. mindspore/bin/cache_server +0 -0
  56. mindspore/boost/base.py +2 -2
  57. mindspore/boost/boost.py +27 -32
  58. mindspore/boost/boost_cell_wrapper.py +37 -13
  59. mindspore/boost/grad_accumulation.py +1 -1
  60. mindspore/boost/grad_freeze.py +34 -6
  61. mindspore/boost/group_loss_scale_manager.py +15 -14
  62. mindspore/boost/less_batch_normalization.py +28 -3
  63. mindspore/common/__init__.py +15 -11
  64. mindspore/common/_auto_dynamic.py +68 -0
  65. mindspore/common/_jit_fallback_utils.py +111 -0
  66. mindspore/common/_register_for_adapter.py +17 -5
  67. mindspore/common/_register_for_tensor.py +2 -2
  68. mindspore/common/_stub_tensor.py +18 -15
  69. mindspore/common/_utils.py +31 -7
  70. mindspore/common/api.py +269 -101
  71. mindspore/common/auto_dynamic_shape.py +498 -0
  72. mindspore/common/dtype.py +61 -21
  73. mindspore/common/dump.py +9 -7
  74. mindspore/common/initializer.py +106 -76
  75. mindspore/common/jit_config.py +35 -14
  76. mindspore/common/lazy_inline.py +187 -0
  77. mindspore/common/mindir_util.py +101 -0
  78. mindspore/common/mutable.py +10 -13
  79. mindspore/common/parameter.py +246 -55
  80. mindspore/common/seed.py +13 -7
  81. mindspore/common/sparse_tensor.py +29 -33
  82. mindspore/common/tensor.py +907 -251
  83. mindspore/communication/__init__.py +7 -4
  84. mindspore/communication/_comm_helper.py +84 -4
  85. mindspore/communication/management.py +160 -88
  86. mindspore/config/op_info.config +99 -75
  87. mindspore/config/super_bar_config.json +36 -4
  88. mindspore/context.py +526 -219
  89. mindspore/dataset/__init__.py +9 -46
  90. mindspore/dataset/audio/__init__.py +4 -19
  91. mindspore/dataset/audio/transforms.py +545 -233
  92. mindspore/dataset/audio/utils.py +21 -18
  93. mindspore/dataset/callback/ds_callback.py +42 -13
  94. mindspore/dataset/core/config.py +158 -100
  95. mindspore/dataset/core/validator_helpers.py +1 -63
  96. mindspore/dataset/debug/debug_hook.py +45 -13
  97. mindspore/dataset/debug/pre_defined_hook.py +5 -5
  98. mindspore/dataset/engine/__init__.py +0 -5
  99. mindspore/dataset/engine/cache_client.py +38 -15
  100. mindspore/dataset/engine/datasets.py +615 -278
  101. mindspore/dataset/engine/datasets_audio.py +154 -283
  102. mindspore/dataset/engine/datasets_standard_format.py +104 -116
  103. mindspore/dataset/engine/datasets_text.py +443 -326
  104. mindspore/dataset/engine/datasets_user_defined.py +251 -164
  105. mindspore/dataset/engine/datasets_vision.py +839 -1443
  106. mindspore/dataset/engine/iterators.py +11 -4
  107. mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +7 -3
  108. mindspore/dataset/engine/obs/util.py +3 -0
  109. mindspore/dataset/engine/offload.py +6 -6
  110. mindspore/dataset/engine/queue.py +15 -14
  111. mindspore/dataset/engine/samplers.py +39 -23
  112. mindspore/dataset/engine/serializer_deserializer.py +22 -6
  113. mindspore/dataset/engine/validators.py +21 -331
  114. mindspore/dataset/text/__init__.py +5 -33
  115. mindspore/dataset/text/transforms.py +334 -165
  116. mindspore/dataset/text/utils.py +215 -145
  117. mindspore/dataset/transforms/__init__.py +1 -1
  118. mindspore/dataset/transforms/c_transforms.py +3 -2
  119. mindspore/dataset/transforms/py_transforms_util.py +40 -12
  120. mindspore/dataset/transforms/transforms.py +174 -71
  121. mindspore/dataset/utils/browse_dataset.py +25 -17
  122. mindspore/dataset/utils/line_reader.py +24 -21
  123. mindspore/dataset/vision/__init__.py +5 -26
  124. mindspore/dataset/vision/c_transforms.py +177 -165
  125. mindspore/dataset/vision/py_transforms.py +114 -119
  126. mindspore/dataset/vision/py_transforms_util.py +54 -51
  127. mindspore/dataset/vision/transforms.py +1127 -381
  128. mindspore/dataset/vision/utils.py +54 -38
  129. mindspore/dataset/vision/validators.py +12 -2
  130. mindspore/experimental/map_parameter.py +38 -4
  131. mindspore/{dataset/datapreprocess → experimental/optim}/__init__.py +14 -4
  132. mindspore/experimental/optim/adam.py +192 -0
  133. mindspore/experimental/optim/adamw.py +181 -0
  134. mindspore/experimental/optim/lr_scheduler.py +1427 -0
  135. mindspore/experimental/optim/optimizer.py +252 -0
  136. mindspore/experimental/optim/sgd.py +147 -0
  137. mindspore/gen_ops.py +273 -0
  138. mindspore/include/OWNERS +1 -2
  139. mindspore/include/api/context.h +21 -1
  140. mindspore/include/api/data_type.h +2 -1
  141. mindspore/include/api/graph.h +0 -15
  142. mindspore/include/api/kernel.h +2 -0
  143. mindspore/include/api/kernel_api.h +37 -12
  144. mindspore/include/api/model.h +29 -42
  145. mindspore/include/api/model_group.h +14 -3
  146. mindspore/include/api/model_parallel_runner.h +18 -2
  147. mindspore/include/api/serialization.h +26 -0
  148. mindspore/include/api/status.h +1 -0
  149. mindspore/include/api/types.h +38 -4
  150. mindspore/include/c_api/ms/abstract.h +67 -0
  151. mindspore/include/c_api/ms/attribute.h +197 -0
  152. mindspore/include/c_api/ms/base/handle_types.h +43 -0
  153. mindspore/include/c_api/ms/base/macros.h +32 -0
  154. mindspore/include/c_api/ms/base/status.h +33 -0
  155. mindspore/include/c_api/ms/base/types.h +282 -0
  156. mindspore/include/c_api/ms/context.h +102 -0
  157. mindspore/include/c_api/ms/graph.h +160 -0
  158. mindspore/include/c_api/ms/node.h +606 -0
  159. mindspore/include/c_api/ms/tensor.h +161 -0
  160. mindspore/include/c_api/ms/value.h +84 -0
  161. mindspore/include/c_api/status_c.h +3 -0
  162. mindspore/include/dataset/constants.h +6 -12
  163. mindspore/include/dataset/execute.h +23 -13
  164. mindspore/include/dataset/text.h +26 -26
  165. mindspore/include/dataset/transforms.h +25 -31
  166. mindspore/include/dataset/vision.h +60 -60
  167. mindspore/include/dataset/vision_ascend.h +5 -6
  168. mindspore/include/dataset/vision_lite.h +17 -17
  169. mindspore/include/mindapi/base/format.h +0 -1
  170. mindspore/include/mindapi/base/type_id.h +2 -1
  171. mindspore/include/mindapi/base/types.h +5 -1
  172. mindspore/lib/libdnnl.so.2 +0 -0
  173. mindspore/lib/libjemalloc.so.2 +0 -0
  174. mindspore/lib/libmindspore.so +0 -0
  175. mindspore/lib/libmindspore_backend.so +0 -0
  176. mindspore/lib/libmindspore_common.so +0 -0
  177. mindspore/lib/libmindspore_core.so +0 -0
  178. mindspore/lib/libmindspore_glog.so.0 +0 -0
  179. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  180. mindspore/lib/libmindspore_grpc++.so.1 +0 -0
  181. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  182. mindspore/lib/libmindspore_shared_lib.so +0 -0
  183. mindspore/lib/libmpi_adapter.so +0 -0
  184. mindspore/lib/libnnacl.so +0 -0
  185. mindspore/lib/libopencv_core.so.4.5 +0 -0
  186. mindspore/lib/libopencv_imgcodecs.so.4.5 +0 -0
  187. mindspore/lib/libopencv_imgproc.so.4.5 +0 -0
  188. mindspore/lib/libps_cache.so +0 -0
  189. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_aicpu_kernels.so +0 -0
  190. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  191. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +9000 -0
  192. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  193. mindspore/lib/plugin/ascend/libakg.so +0 -0
  194. mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
  195. mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
  196. mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
  197. mindspore/lib/plugin/ascend/libmindspore_aicpu_kernels.so +0 -0
  198. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  199. mindspore/lib/plugin/cpu/libakg.so +0 -0
  200. mindspore/lib/plugin/libmindspore_ascend.so.1 +0 -0
  201. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  202. mindspore/log.py +9 -6
  203. mindspore/mindrecord/filereader.py +33 -4
  204. mindspore/mindrecord/filewriter.py +70 -35
  205. mindspore/mindrecord/mindpage.py +40 -34
  206. mindspore/mindrecord/shardreader.py +1 -1
  207. mindspore/mindrecord/shardsegment.py +1 -1
  208. mindspore/mindrecord/tools/cifar100_to_mr.py +25 -18
  209. mindspore/mindrecord/tools/cifar10_to_mr.py +25 -18
  210. mindspore/mindrecord/tools/csv_to_mr.py +29 -13
  211. mindspore/mindrecord/tools/imagenet_to_mr.py +24 -10
  212. mindspore/mindrecord/tools/mnist_to_mr.py +24 -11
  213. mindspore/mindrecord/tools/tfrecord_to_mr.py +31 -26
  214. mindspore/nn/cell.py +463 -169
  215. mindspore/nn/dynamic_lr.py +47 -43
  216. mindspore/nn/layer/activation.py +225 -82
  217. mindspore/nn/layer/basic.py +121 -79
  218. mindspore/nn/layer/channel_shuffle.py +21 -21
  219. mindspore/nn/layer/combined.py +33 -26
  220. mindspore/nn/layer/container.py +277 -22
  221. mindspore/nn/layer/conv.py +441 -304
  222. mindspore/nn/layer/dense.py +19 -13
  223. mindspore/nn/layer/embedding.py +62 -49
  224. mindspore/nn/layer/flash_attention.py +264 -0
  225. mindspore/nn/layer/image.py +50 -39
  226. mindspore/nn/layer/math.py +62 -51
  227. mindspore/nn/layer/normalization.py +219 -167
  228. mindspore/nn/layer/padding.py +58 -70
  229. mindspore/nn/layer/pooling.py +334 -287
  230. mindspore/nn/layer/rnn_cells.py +53 -38
  231. mindspore/nn/layer/rnns.py +59 -56
  232. mindspore/nn/layer/thor_layer.py +52 -44
  233. mindspore/nn/layer/timedistributed.py +6 -4
  234. mindspore/nn/layer/transformer.py +284 -164
  235. mindspore/nn/learning_rate_schedule.py +34 -25
  236. mindspore/nn/loss/__init__.py +3 -2
  237. mindspore/nn/loss/loss.py +554 -311
  238. mindspore/nn/optim/ada_grad.py +12 -9
  239. mindspore/nn/optim/adadelta.py +14 -11
  240. mindspore/nn/optim/adafactor.py +19 -16
  241. mindspore/nn/optim/adam.py +62 -47
  242. mindspore/nn/optim/adamax.py +13 -10
  243. mindspore/nn/optim/adasum.py +12 -8
  244. mindspore/nn/optim/asgd.py +10 -9
  245. mindspore/nn/optim/ftrl.py +20 -17
  246. mindspore/nn/optim/lamb.py +16 -12
  247. mindspore/nn/optim/lars.py +8 -6
  248. mindspore/nn/optim/lazyadam.py +25 -20
  249. mindspore/nn/optim/momentum.py +10 -7
  250. mindspore/nn/optim/optimizer.py +61 -9
  251. mindspore/nn/optim/proximal_ada_grad.py +14 -13
  252. mindspore/nn/optim/rmsprop.py +17 -13
  253. mindspore/nn/optim/rprop.py +30 -17
  254. mindspore/nn/optim/sgd.py +40 -23
  255. mindspore/nn/optim/thor.py +24 -26
  256. mindspore/nn/probability/bijector/bijector.py +11 -11
  257. mindspore/nn/probability/bijector/exp.py +1 -1
  258. mindspore/nn/probability/bijector/gumbel_cdf.py +3 -3
  259. mindspore/nn/probability/bijector/invert.py +1 -1
  260. mindspore/nn/probability/bijector/power_transform.py +29 -29
  261. mindspore/nn/probability/bijector/scalar_affine.py +3 -3
  262. mindspore/nn/probability/bijector/softplus.py +5 -5
  263. mindspore/nn/probability/bnn_layers/bnn_cell_wrapper.py +4 -2
  264. mindspore/nn/probability/bnn_layers/conv_variational.py +13 -13
  265. mindspore/nn/probability/bnn_layers/dense_variational.py +12 -12
  266. mindspore/nn/probability/bnn_layers/layer_distribution.py +9 -8
  267. mindspore/nn/probability/distribution/_utils/custom_ops.py +19 -3
  268. mindspore/nn/probability/distribution/_utils/utils.py +1 -1
  269. mindspore/nn/probability/distribution/bernoulli.py +9 -9
  270. mindspore/nn/probability/distribution/beta.py +8 -8
  271. mindspore/nn/probability/distribution/categorical.py +23 -15
  272. mindspore/nn/probability/distribution/cauchy.py +5 -6
  273. mindspore/nn/probability/distribution/distribution.py +3 -3
  274. mindspore/nn/probability/distribution/exponential.py +4 -4
  275. mindspore/nn/probability/distribution/gamma.py +10 -10
  276. mindspore/nn/probability/distribution/geometric.py +8 -8
  277. mindspore/nn/probability/distribution/gumbel.py +8 -9
  278. mindspore/nn/probability/distribution/half_normal.py +5 -5
  279. mindspore/nn/probability/distribution/laplace.py +5 -5
  280. mindspore/nn/probability/distribution/log_normal.py +12 -11
  281. mindspore/nn/probability/distribution/logistic.py +8 -8
  282. mindspore/nn/probability/distribution/normal.py +6 -5
  283. mindspore/nn/probability/distribution/poisson.py +10 -11
  284. mindspore/nn/probability/distribution/student_t.py +8 -9
  285. mindspore/nn/probability/distribution/transformed_distribution.py +5 -5
  286. mindspore/nn/probability/distribution/uniform.py +11 -11
  287. mindspore/nn/reinforcement/tensor_array.py +2 -2
  288. mindspore/nn/sparse/sparse.py +9 -9
  289. mindspore/nn/wrap/cell_wrapper.py +188 -63
  290. mindspore/nn/wrap/grad_reducer.py +21 -12
  291. mindspore/nn/wrap/loss_scale.py +136 -49
  292. mindspore/numpy/__init__.py +4 -4
  293. mindspore/numpy/array_creations.py +55 -56
  294. mindspore/numpy/array_ops.py +134 -35
  295. mindspore/numpy/logic_ops.py +66 -20
  296. mindspore/numpy/math_ops.py +142 -139
  297. mindspore/numpy/utils_const.py +2 -2
  298. mindspore/offline_debug/convert_async.py +2 -2
  299. mindspore/ops/_grad_experimental/__init__.py +7 -5
  300. mindspore/ops/_grad_experimental/grad_array_ops.py +231 -348
  301. mindspore/ops/{_grad → _grad_experimental}/grad_base.py +1 -33
  302. mindspore/ops/{_grad → _grad_experimental}/grad_comm_ops.py +25 -13
  303. mindspore/ops/{_grad/__init__.py → _grad_experimental/grad_debug_ops.py} +15 -7
  304. mindspore/ops/{_grad → _grad_experimental}/grad_implementations.py +17 -11
  305. mindspore/ops/_grad_experimental/grad_inner_ops.py +33 -52
  306. mindspore/ops/_grad_experimental/grad_math_ops.py +151 -1224
  307. mindspore/ops/_grad_experimental/grad_nn_ops.py +141 -414
  308. mindspore/ops/{_grad → _grad_experimental}/grad_quant_ops.py +10 -6
  309. mindspore/ops/_grad_experimental/grad_sparse.py +317 -2
  310. mindspore/ops/_grad_experimental/grad_sparse_ops.py +3 -13
  311. mindspore/ops/{_grad → _grad_experimental}/taylor_rule.py +1 -1
  312. mindspore/ops/_op_impl/_custom_op/dsd_back_impl.py +1 -1
  313. mindspore/ops/_op_impl/_custom_op/flash_attention/__init__.py +0 -0
  314. mindspore/ops/_op_impl/_custom_op/flash_attention/attention.py +406 -0
  315. mindspore/{_extends/graph_kernel/expanders/complex/__init__.py → ops/_op_impl/_custom_op/flash_attention/constants.py} +27 -8
  316. mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_bwd.py +467 -0
  317. mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_fwd.py +563 -0
  318. mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_impl.py +193 -0
  319. mindspore/ops/_op_impl/_custom_op/flash_attention/tik_ops_utils.py +435 -0
  320. mindspore/ops/_op_impl/_custom_op/flash_attention/tiling_strategy/__init__.py +0 -0
  321. mindspore/ops/_op_impl/_custom_op/flash_attention/tiling_strategy/sparse_tiling.py +45 -0
  322. mindspore/ops/_op_impl/_custom_op/flash_attention/tiling_strategy/strategy.py +67 -0
  323. mindspore/ops/_op_impl/_custom_op/flash_attention/tiling_strategy/wukong_tiling.py +62 -0
  324. mindspore/ops/_op_impl/_custom_op/matmul_cube_dense_left_impl.py +2 -2
  325. mindspore/ops/_op_impl/aicpu/__init__.py +41 -1
  326. mindspore/ops/_op_impl/aicpu/adaptive_max_pool_2d.py +37 -0
  327. mindspore/ops/_op_impl/aicpu/bias_add_grad.py +0 -1
  328. mindspore/ops/_op_impl/aicpu/cast.py +52 -0
  329. mindspore/ops/_op_impl/aicpu/coalesce.py +2 -0
  330. mindspore/ops/_op_impl/aicpu/col2im.py +3 -1
  331. mindspore/ops/_op_impl/aicpu/count_nonzero.py +43 -0
  332. mindspore/ops/_op_impl/aicpu/dropout_genmask.py +6 -0
  333. mindspore/ops/_op_impl/aicpu/eps.py +32 -0
  334. mindspore/ops/_op_impl/aicpu/eye.py +4 -4
  335. mindspore/ops/_op_impl/aicpu/fft_with_size.py +6 -0
  336. mindspore/ops/_op_impl/aicpu/fill_diagonal.py +5 -0
  337. mindspore/ops/_op_impl/aicpu/gamma.py +2 -2
  338. mindspore/ops/_op_impl/aicpu/im2col.py +3 -5
  339. mindspore/ops/_op_impl/aicpu/lgamma.py +1 -0
  340. mindspore/ops/_op_impl/aicpu/log_uniform_candidate_sampler.py +6 -3
  341. mindspore/ops/_op_impl/aicpu/lu.py +39 -0
  342. mindspore/ops/_op_impl/aicpu/lu_unpack_grad.py +0 -1
  343. mindspore/ops/_op_impl/aicpu/masked_scatter.py +1 -0
  344. mindspore/ops/_op_impl/aicpu/masked_select_grad.py +3 -0
  345. mindspore/ops/_op_impl/aicpu/matrix_band_part.py +59 -0
  346. mindspore/ops/_op_impl/aicpu/matrix_power.py +6 -1
  347. mindspore/ops/_op_impl/aicpu/median.py +1 -0
  348. mindspore/ops/_op_impl/aicpu/multinomial.py +9 -9
  349. mindspore/ops/_op_impl/aicpu/not_equal.py +0 -5
  350. mindspore/ops/_op_impl/aicpu/pad_v3.py +3 -1
  351. mindspore/ops/_op_impl/aicpu/pad_v3_grad.py +2 -0
  352. mindspore/ops/_op_impl/aicpu/parameterized_truncated_normal.py +15 -7
  353. mindspore/ops/_op_impl/aicpu/random_categorical.py +39 -19
  354. mindspore/ops/_op_impl/aicpu/random_choice_with_mask.py +5 -2
  355. mindspore/ops/_op_impl/aicpu/random_poisson.py +103 -52
  356. mindspore/ops/_op_impl/aicpu/random_shuffle.py +17 -15
  357. mindspore/ops/_op_impl/aicpu/resize_bilinear_grad.py +0 -1
  358. mindspore/ops/_op_impl/aicpu/resize_nearest_neighbor_v2.py +0 -6
  359. mindspore/ops/_op_impl/aicpu/resize_nearest_neighbor_v2_grad.py +0 -7
  360. mindspore/ops/_op_impl/aicpu/scatter_nd.py +2 -0
  361. mindspore/ops/_op_impl/aicpu/sequence_concat.py +40 -0
  362. mindspore/ops/_op_impl/aicpu/sequence_stack.py +40 -0
  363. mindspore/ops/_op_impl/aicpu/{sparseaddmm.py → sparse_addmm.py} +2 -2
  364. mindspore/ops/_op_impl/aicpu/{sparsesparsemaximum.py → sparse_sparse_maximum.py} +4 -4
  365. mindspore/ops/_op_impl/aicpu/standard_laplace.py +5 -4
  366. mindspore/ops/_op_impl/aicpu/standard_normal.py +5 -4
  367. mindspore/ops/_op_impl/aicpu/truncated_normal.py +9 -7
  368. mindspore/ops/_op_impl/aicpu/uniform.py +5 -3
  369. mindspore/ops/_op_impl/aicpu/uniform_candidate_sampler.py +8 -4
  370. mindspore/ops/_op_impl/aicpu/uniform_int.py +5 -5
  371. mindspore/ops/_op_impl/aicpu/uniform_real.py +4 -4
  372. mindspore/ops/_op_impl/aicpu/upsample_nearest_3d.py +14 -6
  373. mindspore/ops/_op_impl/aicpu/upsample_nearest_3d_grad.py +22 -8
  374. mindspore/ops/_op_impl/aicpu/upsample_trilinear_3d.py +11 -6
  375. mindspore/ops/_op_impl/aicpu/upsample_trilinear_3d_grad.py +21 -10
  376. mindspore/ops/_op_impl/tbe/__init__.py +6 -4
  377. mindspore/ops/_op_impl/tbe/atomic_addr_clean.py +1 -1
  378. mindspore/ops/_op_impl/tbe/avg_pool.py +2 -2
  379. mindspore/ops/_op_impl/tbe/avg_pool_3d.py +3 -3
  380. mindspore/ops/_op_impl/tbe/avg_pool_3d_grad.py +4 -4
  381. mindspore/ops/_op_impl/tbe/avg_pool_ds.py +2 -2
  382. mindspore/ops/_op_impl/tbe/avg_pool_grad.py +3 -3
  383. mindspore/ops/_op_impl/tbe/avg_pool_grad_vm.py +3 -3
  384. mindspore/ops/_op_impl/tbe/batch_to_space.py +1 -1
  385. mindspore/ops/_op_impl/tbe/batch_to_space_nd.py +2 -2
  386. mindspore/ops/_op_impl/tbe/bn_infer.py +2 -2
  387. mindspore/ops/_op_impl/tbe/bn_infer_ds.py +3 -2
  388. mindspore/ops/_op_impl/tbe/broadcast_to.py +1 -1
  389. mindspore/ops/_op_impl/tbe/depthwise_conv2d.py +3 -3
  390. mindspore/ops/_op_impl/tbe/expand_dims.py +1 -1
  391. mindspore/ops/_op_impl/tbe/gather_v2.py +56 -0
  392. mindspore/ops/_op_impl/tbe/im2col.py +4 -4
  393. mindspore/ops/_op_impl/tbe/inplace_index_add.py +7 -3
  394. mindspore/ops/_op_impl/tbe/mem_set.py +38 -0
  395. mindspore/ops/_op_impl/tbe/scatter_nd_add.py +3 -0
  396. mindspore/ops/_op_impl/tbe/scatter_nd_d.py +1 -1
  397. mindspore/ops/_op_impl/tbe/space_to_batch.py +1 -1
  398. mindspore/ops/_op_impl/tbe/space_to_batch_nd.py +2 -2
  399. mindspore/ops/_op_impl/tbe/trans_data_ds.py +2 -0
  400. mindspore/ops/_primitive_cache.py +1 -1
  401. mindspore/ops/_tracefunc.py +241 -0
  402. mindspore/ops/_utils/utils.py +10 -2
  403. mindspore/ops/_vmap/vmap_array_ops.py +5 -3
  404. mindspore/ops/_vmap/vmap_base.py +5 -4
  405. mindspore/ops/_vmap/vmap_convolution_ops.py +1 -1
  406. mindspore/ops/_vmap/vmap_grad_math_ops.py +6 -4
  407. mindspore/ops/_vmap/vmap_grad_nn_ops.py +11 -6
  408. mindspore/ops/_vmap/vmap_math_ops.py +5 -2
  409. mindspore/ops/_vmap/vmap_nn_ops.py +135 -11
  410. mindspore/ops/arg_dtype_cast.py +54 -0
  411. mindspore/ops/composite/__init__.py +7 -5
  412. mindspore/ops/composite/base.py +78 -34
  413. mindspore/ops/composite/math_ops.py +5 -695
  414. mindspore/ops/composite/multitype_ops/_compile_utils.py +403 -97
  415. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +28 -22
  416. mindspore/ops/composite/multitype_ops/add_impl.py +69 -7
  417. mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +2 -1
  418. mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +2 -1
  419. mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +2 -0
  420. mindspore/ops/composite/multitype_ops/div_impl.py +1 -0
  421. mindspore/ops/composite/multitype_ops/floordiv_impl.py +1 -0
  422. mindspore/ops/composite/multitype_ops/getitem_impl.py +48 -10
  423. mindspore/ops/composite/multitype_ops/greater_equal_impl.py +2 -0
  424. mindspore/ops/composite/multitype_ops/greater_impl.py +2 -0
  425. mindspore/ops/composite/multitype_ops/left_shift_impl.py +2 -0
  426. mindspore/ops/composite/multitype_ops/less_equal_impl.py +2 -0
  427. mindspore/ops/composite/multitype_ops/less_impl.py +2 -0
  428. mindspore/ops/composite/multitype_ops/logic_not_impl.py +2 -2
  429. mindspore/ops/composite/multitype_ops/mod_impl.py +1 -0
  430. mindspore/ops/composite/multitype_ops/mul_impl.py +1 -0
  431. mindspore/ops/composite/multitype_ops/negative_impl.py +1 -0
  432. mindspore/ops/composite/multitype_ops/not_in_impl.py +1 -0
  433. mindspore/ops/composite/multitype_ops/ones_like_impl.py +6 -0
  434. mindspore/ops/composite/multitype_ops/pow_impl.py +1 -0
  435. mindspore/ops/composite/multitype_ops/right_shift_impl.py +2 -0
  436. mindspore/ops/composite/multitype_ops/setitem_impl.py +10 -7
  437. mindspore/ops/composite/multitype_ops/sub_impl.py +1 -0
  438. mindspore/ops/composite/multitype_ops/uadd_impl.py +2 -0
  439. mindspore/ops/composite/multitype_ops/zeros_like_impl.py +9 -0
  440. mindspore/ops/deprecated.py +304 -0
  441. mindspore/ops/function/__init__.py +41 -4
  442. mindspore/ops/function/array_func.py +1108 -467
  443. mindspore/ops/function/clip_func.py +94 -27
  444. mindspore/ops/function/debug_func.py +3 -1
  445. mindspore/ops/function/grad/grad_func.py +82 -73
  446. mindspore/ops/function/image_func.py +28 -12
  447. mindspore/ops/function/linalg_func.py +135 -39
  448. mindspore/ops/function/math_func.py +3779 -894
  449. mindspore/ops/function/nn_func.py +1584 -657
  450. mindspore/ops/function/parameter_func.py +13 -3
  451. mindspore/ops/function/random_func.py +247 -153
  452. mindspore/ops/function/sparse_func.py +14 -11
  453. mindspore/ops/function/sparse_unary_func.py +173 -47
  454. mindspore/ops/function/spectral_func.py +8 -4
  455. mindspore/ops/function/vmap_func.py +8 -7
  456. mindspore/ops/functional.py +47 -16
  457. mindspore/ops/op_info_register.py +346 -86
  458. mindspore/ops/operations/__init__.py +38 -22
  459. mindspore/ops/operations/_grad_ops.py +145 -149
  460. mindspore/ops/operations/_inner_ops.py +298 -56
  461. mindspore/ops/operations/_ms_kernel.py +3 -3
  462. mindspore/ops/operations/_quant_ops.py +24 -28
  463. mindspore/ops/operations/_rl_inner_ops.py +9 -7
  464. mindspore/ops/operations/_scalar_ops.py +115 -0
  465. mindspore/ops/operations/_sequence_ops.py +148 -10
  466. mindspore/ops/operations/_tensor_array.py +1 -1
  467. mindspore/ops/operations/_thor_ops.py +2 -2
  468. mindspore/ops/operations/array_ops.py +1239 -561
  469. mindspore/ops/operations/comm_ops.py +166 -90
  470. mindspore/ops/operations/control_ops.py +3 -3
  471. mindspore/ops/operations/custom_ops.py +124 -102
  472. mindspore/ops/operations/debug_ops.py +24 -11
  473. mindspore/ops/operations/image_ops.py +86 -71
  474. mindspore/ops/operations/inner_ops.py +18 -13
  475. mindspore/ops/operations/linalg_ops.py +30 -11
  476. mindspore/ops/operations/math_ops.py +1730 -435
  477. mindspore/ops/operations/nn_ops.py +1953 -943
  478. mindspore/ops/operations/other_ops.py +65 -43
  479. mindspore/ops/operations/random_ops.py +258 -98
  480. mindspore/ops/operations/rl_ops.py +4 -36
  481. mindspore/ops/operations/sparse_ops.py +38 -33
  482. mindspore/ops/operations/spectral_ops.py +8 -4
  483. mindspore/ops/primitive.py +66 -44
  484. mindspore/ops/signature.py +5 -5
  485. mindspore/parallel/_auto_parallel_context.py +80 -19
  486. mindspore/parallel/_cost_model_context.py +42 -0
  487. mindspore/parallel/_offload_context.py +162 -72
  488. mindspore/parallel/_parallel_serialization.py +2 -2
  489. mindspore/parallel/_ps_context.py +16 -4
  490. mindspore/parallel/_recovery_context.py +2 -1
  491. mindspore/parallel/_tensor.py +15 -13
  492. mindspore/parallel/_transformer/layers.py +8 -6
  493. mindspore/parallel/_transformer/loss.py +1 -0
  494. mindspore/parallel/_transformer/moe.py +7 -7
  495. mindspore/parallel/_transformer/op_parallel_config.py +12 -1
  496. mindspore/parallel/_transformer/transformer.py +34 -14
  497. mindspore/parallel/_utils.py +36 -14
  498. mindspore/parallel/algo_parameter_config.py +114 -20
  499. mindspore/parallel/checkpoint_transform.py +16 -18
  500. mindspore/parallel/shard.py +16 -13
  501. mindspore/profiler/__init__.py +1 -1
  502. mindspore/profiler/common/struct_type.py +3 -3
  503. mindspore/profiler/common/util.py +3 -2
  504. mindspore/profiler/envprofiling.py +11 -4
  505. mindspore/profiler/parser/aicpu_data_parser.py +5 -3
  506. mindspore/profiler/parser/ascend_flops_generator.py +94 -0
  507. mindspore/profiler/parser/ascend_fpbp_generator.py +76 -0
  508. mindspore/profiler/parser/ascend_hccl_generator.py +288 -0
  509. mindspore/profiler/parser/ascend_msprof_exporter.py +213 -0
  510. mindspore/profiler/parser/ascend_msprof_generator.py +199 -0
  511. mindspore/profiler/parser/ascend_op_generator.py +276 -0
  512. mindspore/profiler/parser/ascend_steptrace_generator.py +94 -0
  513. mindspore/profiler/parser/ascend_timeline_generator.py +110 -54
  514. mindspore/profiler/parser/base_timeline_generator.py +11 -7
  515. mindspore/profiler/parser/cpu_gpu_timeline_generator.py +45 -46
  516. mindspore/profiler/parser/flops_parser.py +15 -11
  517. mindspore/profiler/parser/framework_parser.py +92 -73
  518. mindspore/profiler/parser/hccl_parser.py +16 -12
  519. mindspore/profiler/parser/integrator.py +22 -11
  520. mindspore/profiler/parser/memory_usage_parser.py +36 -11
  521. mindspore/profiler/parser/minddata_analyzer.py +12 -14
  522. mindspore/profiler/parser/minddata_pipeline_parser.py +1 -1
  523. mindspore/profiler/parser/msadvisor_parser.py +8 -4
  524. mindspore/profiler/parser/op_intermediate_parser.py +5 -2
  525. mindspore/profiler/parser/optime_parser.py +1 -1
  526. mindspore/profiler/parser/profiler_info.py +4 -5
  527. mindspore/profiler/parser/step_trace_parser.py +11 -14
  528. mindspore/profiler/profiling.py +678 -377
  529. mindspore/rewrite/api/node.py +211 -54
  530. mindspore/rewrite/api/node_type.py +5 -0
  531. mindspore/rewrite/api/pattern_engine.py +22 -23
  532. mindspore/rewrite/api/scoped_value.py +20 -17
  533. mindspore/rewrite/api/symbol_tree.py +252 -106
  534. mindspore/rewrite/api/tree_node_helper.py +3 -0
  535. mindspore/rewrite/ast_helpers/__init__.py +2 -1
  536. mindspore/rewrite/ast_helpers/ast_finder.py +129 -0
  537. mindspore/rewrite/ast_helpers/ast_modifier.py +116 -104
  538. mindspore/rewrite/ast_transformers/flatten_recursive_stmt.py +97 -46
  539. mindspore/rewrite/common/rewrite_elog.py +5 -1
  540. mindspore/rewrite/namer.py +51 -51
  541. mindspore/rewrite/namespace.py +14 -5
  542. mindspore/{ops/bprop_mindir → rewrite/node}/__init__.py +9 -4
  543. mindspore/rewrite/node/call_function.py +79 -0
  544. mindspore/rewrite/node/cell_container.py +135 -0
  545. mindspore/rewrite/node/control_flow.py +88 -0
  546. mindspore/rewrite/{node.py → node/node.py} +313 -247
  547. mindspore/rewrite/node/node_manager.py +254 -0
  548. mindspore/rewrite/node/node_topological_manager.py +243 -0
  549. mindspore/rewrite/parsers/arguments_parser.py +22 -21
  550. mindspore/rewrite/parsers/assign_parser.py +225 -239
  551. mindspore/rewrite/parsers/attribute_parser.py +9 -7
  552. mindspore/rewrite/parsers/class_def_parser.py +179 -218
  553. mindspore/rewrite/parsers/constant_parser.py +9 -6
  554. mindspore/rewrite/parsers/container_parser.py +9 -7
  555. mindspore/rewrite/parsers/for_parser.py +36 -15
  556. mindspore/rewrite/parsers/function_def_parser.py +23 -20
  557. mindspore/rewrite/parsers/if_parser.py +28 -24
  558. mindspore/rewrite/parsers/module_parser.py +202 -25
  559. mindspore/rewrite/{parser.py → parsers/parser.py} +4 -2
  560. mindspore/rewrite/{parser_register.py → parsers/parser_register.py} +1 -1
  561. mindspore/rewrite/parsers/return_parser.py +6 -6
  562. mindspore/rewrite/sparsify/sparse_transformer.py +12 -3
  563. mindspore/rewrite/sparsify/sparsify.py +4 -1
  564. mindspore/rewrite/sparsify/utils.py +11 -5
  565. mindspore/rewrite/symbol_tree.py +577 -732
  566. mindspore/rewrite/symbol_tree_builder.py +9 -175
  567. mindspore/rewrite/symbol_tree_dumper.py +2 -2
  568. mindspore/run_check/_check_version.py +46 -39
  569. mindspore/run_check/run_check.py +3 -2
  570. mindspore/{scipy/sparse → safeguard}/__init__.py +4 -5
  571. mindspore/safeguard/rewrite_obfuscation.py +517 -0
  572. mindspore/scipy/__init__.py +1 -1
  573. mindspore/scipy/linalg.py +67 -61
  574. mindspore/scipy/ops.py +5 -41
  575. mindspore/scipy/ops_grad.py +3 -2
  576. mindspore/scipy/ops_wrapper.py +5 -5
  577. mindspore/scipy/optimize/line_search.py +8 -8
  578. mindspore/scipy/optimize/linear_sum_assignment.py +4 -4
  579. mindspore/scipy/optimize/minimize.py +16 -12
  580. mindspore/scipy/utils.py +1 -52
  581. mindspore/scipy/utils_const.py +4 -4
  582. mindspore/train/__init__.py +4 -4
  583. mindspore/train/_utils.py +13 -5
  584. mindspore/train/amp.py +410 -148
  585. mindspore/train/anf_ir_pb2.py +16 -4
  586. mindspore/train/callback/_backup_and_restore.py +8 -11
  587. mindspore/train/callback/_callback.py +80 -3
  588. mindspore/train/callback/_checkpoint.py +82 -51
  589. mindspore/train/callback/_early_stop.py +12 -15
  590. mindspore/train/callback/_history.py +1 -1
  591. mindspore/train/callback/_lambda_callback.py +13 -13
  592. mindspore/train/callback/_landscape.py +21 -17
  593. mindspore/train/callback/_loss_monitor.py +9 -10
  594. mindspore/train/callback/_on_request_exit.py +16 -33
  595. mindspore/train/callback/_reduce_lr_on_plateau.py +21 -24
  596. mindspore/train/callback/_summary_collector.py +44 -30
  597. mindspore/train/callback/_time_monitor.py +62 -12
  598. mindspore/train/data_sink.py +10 -16
  599. mindspore/train/dataset_helper.py +154 -86
  600. mindspore/train/loss_scale_manager.py +14 -9
  601. mindspore/train/metrics/__init__.py +10 -2
  602. mindspore/train/metrics/accuracy.py +1 -1
  603. mindspore/train/metrics/auc.py +1 -1
  604. mindspore/train/metrics/bleu_score.py +2 -2
  605. mindspore/train/metrics/confusion_matrix.py +14 -14
  606. mindspore/train/metrics/cosine_similarity.py +3 -3
  607. mindspore/train/metrics/dice.py +1 -1
  608. mindspore/train/metrics/fbeta.py +1 -1
  609. mindspore/train/metrics/hausdorff_distance.py +8 -6
  610. mindspore/train/metrics/mean_surface_distance.py +5 -4
  611. mindspore/train/metrics/metric.py +49 -17
  612. mindspore/train/metrics/occlusion_sensitivity.py +4 -4
  613. mindspore/train/metrics/perplexity.py +1 -1
  614. mindspore/train/metrics/precision.py +2 -2
  615. mindspore/train/metrics/recall.py +2 -3
  616. mindspore/train/metrics/roc.py +7 -7
  617. mindspore/train/metrics/root_mean_square_surface_distance.py +5 -4
  618. mindspore/train/metrics/topk.py +7 -4
  619. mindspore/train/mind_ir_pb2.py +193 -48
  620. mindspore/train/model.py +377 -133
  621. mindspore/train/serialization.py +697 -245
  622. mindspore/train/summary/_summary_adapter.py +5 -2
  623. mindspore/train/summary/_writer_pool.py +4 -3
  624. mindspore/train/summary/summary_record.py +25 -23
  625. mindspore/train/train_thor/convert_utils.py +39 -23
  626. mindspore/train/train_thor/dataset_helper.py +4 -3
  627. mindspore/train/train_thor/model_thor.py +8 -8
  628. mindspore/version.py +1 -1
  629. {mindspore-2.0.0rc1.dist-info → mindspore-2.2.0.dist-info}/METADATA +7 -8
  630. {mindspore-2.0.0rc1.dist-info → mindspore-2.2.0.dist-info}/RECORD +633 -804
  631. {mindspore-2.0.0rc1.dist-info → mindspore-2.2.0.dist-info}/entry_points.txt +0 -1
  632. mindspore/_akg/akg/tvm/contrib/debugger/__init__.py +0 -16
  633. mindspore/_akg/akg/tvm/contrib/debugger/debug_result.py +0 -274
  634. mindspore/_akg/akg/tvm/contrib/debugger/debug_runtime.py +0 -259
  635. mindspore/_akg/akg/tvm/contrib/peak.py +0 -341
  636. mindspore/_akg/akg/tvm/contrib/rpc.py +0 -25
  637. mindspore/_akg/akg/tvm/contrib/xcode.py +0 -257
  638. mindspore/_akg/akg/tvm/exec/__init__.py +0 -17
  639. mindspore/_akg/akg/tvm/exec/autotvm_log_editor.py +0 -60
  640. mindspore/_akg/akg/tvm/exec/measure_peak.py +0 -48
  641. mindspore/_akg/akg/tvm/exec/query_rpc_tracker.py +0 -48
  642. mindspore/_akg/akg/tvm/exec/rpc_proxy.py +0 -98
  643. mindspore/_akg/akg/tvm/exec/rpc_server.py +0 -88
  644. mindspore/_akg/akg/tvm/exec/rpc_tracker.py +0 -62
  645. mindspore/_akg/akg/tvm/rpc/__init__.py +0 -29
  646. mindspore/_akg/akg/tvm/rpc/base.py +0 -182
  647. mindspore/_akg/akg/tvm/rpc/client.py +0 -436
  648. mindspore/_akg/akg/tvm/rpc/proxy.py +0 -595
  649. mindspore/_akg/akg/tvm/rpc/server.py +0 -413
  650. mindspore/_akg/akg/tvm/rpc/tornado_util.py +0 -121
  651. mindspore/_akg/akg/tvm/rpc/tracker.py +0 -431
  652. mindspore/_extends/graph_kernel/expander.py +0 -80
  653. mindspore/_extends/graph_kernel/expanders/__init__.py +0 -57
  654. mindspore/_extends/graph_kernel/expanders/_utils.py +0 -269
  655. mindspore/_extends/graph_kernel/expanders/addn.py +0 -33
  656. mindspore/_extends/graph_kernel/expanders/batchnorm.py +0 -152
  657. mindspore/_extends/graph_kernel/expanders/batchnorm_grad.py +0 -105
  658. mindspore/_extends/graph_kernel/expanders/bias_add_grad.py +0 -49
  659. mindspore/_extends/graph_kernel/expanders/clip_by_norm_no_div_sum.py +0 -33
  660. mindspore/_extends/graph_kernel/expanders/complex/abs.py +0 -30
  661. mindspore/_extends/graph_kernel/expanders/complex/add.py +0 -44
  662. mindspore/_extends/graph_kernel/expanders/complex/div.py +0 -62
  663. mindspore/_extends/graph_kernel/expanders/complex/mul.py +0 -52
  664. mindspore/_extends/graph_kernel/expanders/complex/real_div.py +0 -62
  665. mindspore/_extends/graph_kernel/expanders/complex/sub.py +0 -45
  666. mindspore/_extends/graph_kernel/expanders/conv2d.py +0 -200
  667. mindspore/_extends/graph_kernel/expanders/dropout_grad.py +0 -30
  668. mindspore/_extends/graph_kernel/expanders/equal_count.py +0 -50
  669. mindspore/_extends/graph_kernel/expanders/erfc.py +0 -35
  670. mindspore/_extends/graph_kernel/expanders/expand_dims.py +0 -50
  671. mindspore/_extends/graph_kernel/expanders/fused_adam.py +0 -44
  672. mindspore/_extends/graph_kernel/expanders/fused_adam_weight_decay.py +0 -47
  673. mindspore/_extends/graph_kernel/expanders/fused_mul_add.py +0 -28
  674. mindspore/_extends/graph_kernel/expanders/gather.py +0 -43
  675. mindspore/_extends/graph_kernel/expanders/gelu_grad.py +0 -70
  676. mindspore/_extends/graph_kernel/expanders/gkdropout.py +0 -40
  677. mindspore/_extends/graph_kernel/expanders/identity.py +0 -25
  678. mindspore/_extends/graph_kernel/expanders/layernorm.py +0 -93
  679. mindspore/_extends/graph_kernel/expanders/layernorm_grad.py +0 -113
  680. mindspore/_extends/graph_kernel/expanders/logsoftmax.py +0 -46
  681. mindspore/_extends/graph_kernel/expanders/logsoftmax_grad.py +0 -36
  682. mindspore/_extends/graph_kernel/expanders/matmul.py +0 -80
  683. mindspore/_extends/graph_kernel/expanders/maximum_grad.py +0 -59
  684. mindspore/_extends/graph_kernel/expanders/minimum_grad.py +0 -80
  685. mindspore/_extends/graph_kernel/expanders/oneslike.py +0 -26
  686. mindspore/_extends/graph_kernel/expanders/reduce_mean.py +0 -43
  687. mindspore/_extends/graph_kernel/expanders/relu_grad.py +0 -32
  688. mindspore/_extends/graph_kernel/expanders/sigmoid_cross_entropy_with_logits.py +0 -41
  689. mindspore/_extends/graph_kernel/expanders/sigmoid_cross_entropy_with_logits_grad.py +0 -35
  690. mindspore/_extends/graph_kernel/expanders/sigmoid_grad.py +0 -31
  691. mindspore/_extends/graph_kernel/expanders/slice.py +0 -35
  692. mindspore/_extends/graph_kernel/expanders/softmax_cross_entropy_with_logits.py +0 -42
  693. mindspore/_extends/graph_kernel/expanders/softmax_grad_ext.py +0 -41
  694. mindspore/_extends/graph_kernel/expanders/softsign.py +0 -28
  695. mindspore/_extends/graph_kernel/expanders/sqrt_grad.py +0 -29
  696. mindspore/_extends/graph_kernel/expanders/square_sum_all.py +0 -44
  697. mindspore/_extends/graph_kernel/expanders/square_sum_v1.py +0 -37
  698. mindspore/_extends/graph_kernel/expanders/squared_difference.py +0 -43
  699. mindspore/_extends/graph_kernel/expanders/tanh_grad.py +0 -31
  700. mindspore/_extends/graph_kernel/expanders/tile.py +0 -54
  701. mindspore/_extends/graph_kernel/model/op_infer.py +0 -506
  702. mindspore/_extends/parse/jit_fallback_modules.py +0 -51
  703. mindspore/dataset/datapreprocess/preprocess_imagenet_validate_dataset.py +0 -54
  704. mindspore/dataset/engine/graphdata.py +0 -1586
  705. mindspore/include/api/net.h +0 -142
  706. mindspore/ops/_grad/grad_array_ops.py +0 -1347
  707. mindspore/ops/_grad/grad_clip_ops.py +0 -84
  708. mindspore/ops/_grad/grad_debug_ops.py +0 -68
  709. mindspore/ops/_grad/grad_inner_ops.py +0 -235
  710. mindspore/ops/_grad/grad_math_ops.py +0 -1684
  711. mindspore/ops/_grad/grad_nn_ops.py +0 -1529
  712. mindspore/ops/_grad/grad_other_ops.py +0 -89
  713. mindspore/ops/_grad/grad_sequence_ops.py +0 -296
  714. mindspore/ops/_grad/grad_sparse.py +0 -323
  715. mindspore/ops/_grad_experimental/grad_image_ops.py +0 -249
  716. mindspore/ops/_grad_experimental/grad_linalg_ops.py +0 -195
  717. mindspore/ops/_grad_experimental/grad_scalar_ops.py +0 -112
  718. mindspore/ops/bprop_mindir/AdaptiveAvgPool2D_bprop.mindir +0 -0
  719. mindspore/ops/bprop_mindir/AdaptiveMaxPool2D_bprop.mindir +0 -0
  720. mindspore/ops/bprop_mindir/ApproximateEqual_bprop.mindir +0 -19
  721. mindspore/ops/bprop_mindir/Argmax_bprop.mindir +0 -15
  722. mindspore/ops/bprop_mindir/Argmin_bprop.mindir +0 -15
  723. mindspore/ops/bprop_mindir/AssignSub_bprop.mindir +0 -19
  724. mindspore/ops/bprop_mindir/Assign_bprop.mindir +0 -17
  725. mindspore/ops/bprop_mindir/AvgPool3D_bprop.mindir +0 -150
  726. mindspore/ops/bprop_mindir/AvgPool_bprop.mindir +0 -66
  727. mindspore/ops/bprop_mindir/BCEWithLogitsLoss_bprop.mindir +0 -0
  728. mindspore/ops/bprop_mindir/BNTrainingReduce_bprop.mindir +0 -15
  729. mindspore/ops/bprop_mindir/BatchNormGrad_bprop.mindir +0 -0
  730. mindspore/ops/bprop_mindir/BatchToSpaceND_bprop.mindir +0 -28
  731. mindspore/ops/bprop_mindir/BiasAddGrad_bprop.mindir +0 -0
  732. mindspore/ops/bprop_mindir/BinaryCrossEntropy_bprop.mindir +0 -33
  733. mindspore/ops/bprop_mindir/BroadcastTo_bprop.mindir +0 -306
  734. mindspore/ops/bprop_mindir/Broadcast_bprop.mindir +0 -13
  735. mindspore/ops/bprop_mindir/CTCLoss_bprop.mindir +0 -0
  736. mindspore/ops/bprop_mindir/Concat_bprop.mindir +0 -0
  737. mindspore/ops/bprop_mindir/Conv2DBackpropFilter_bprop.mindir +0 -240
  738. mindspore/ops/bprop_mindir/Conv2DBackpropInput_bprop.mindir +0 -247
  739. mindspore/ops/bprop_mindir/Conv2DTranspose_bprop.mindir +0 -247
  740. mindspore/ops/bprop_mindir/Conv3DTranspose_bprop.mindir +0 -315
  741. mindspore/ops/bprop_mindir/Conv3D_bprop.mindir +0 -278
  742. mindspore/ops/bprop_mindir/DType_bprop.mindir +0 -14
  743. mindspore/ops/bprop_mindir/DeformableOffsets_bprop.mindir +0 -58
  744. mindspore/ops/bprop_mindir/Depend_bprop.mindir +0 -13
  745. mindspore/ops/bprop_mindir/DepthToSpace_bprop.mindir +0 -23
  746. mindspore/ops/bprop_mindir/DepthwiseConv2dNative_bprop.mindir +0 -138
  747. mindspore/ops/bprop_mindir/DiagPart_bprop.mindir +0 -15
  748. mindspore/ops/bprop_mindir/Dropout2D_bprop.mindir +0 -0
  749. mindspore/ops/bprop_mindir/Dropout3D_bprop.mindir +0 -0
  750. mindspore/ops/bprop_mindir/DropoutDoMask_bprop.mindir +0 -25
  751. mindspore/ops/bprop_mindir/DropoutGenMask_bprop.mindir +0 -18
  752. mindspore/ops/bprop_mindir/DropoutGrad_bprop.mindir +0 -27
  753. mindspore/ops/bprop_mindir/Dropout_bprop.mindir +0 -0
  754. mindspore/ops/bprop_mindir/DynamicGRUV2_bprop.mindir +0 -0
  755. mindspore/ops/bprop_mindir/DynamicRNN_bprop.mindir +0 -0
  756. mindspore/ops/bprop_mindir/DynamicShape_bprop.mindir +0 -14
  757. mindspore/ops/bprop_mindir/Elu_bprop.mindir +0 -16
  758. mindspore/ops/bprop_mindir/EmbeddingLookup_bprop.mindir +0 -0
  759. mindspore/ops/bprop_mindir/Equal_bprop.mindir +0 -19
  760. mindspore/ops/bprop_mindir/ExpandDims_bprop.mindir +0 -58
  761. mindspore/ops/bprop_mindir/FastGeLU_bprop.mindir +0 -16
  762. mindspore/ops/bprop_mindir/Flatten_bprop.mindir +0 -54
  763. mindspore/ops/bprop_mindir/FloorDiv_bprop.mindir +0 -19
  764. mindspore/ops/bprop_mindir/GatherD_bprop.mindir +0 -26
  765. mindspore/ops/bprop_mindir/GatherNd_bprop.mindir +0 -57
  766. mindspore/ops/bprop_mindir/Gather_bprop.mindir +0 -0
  767. mindspore/ops/bprop_mindir/GreaterEqual_bprop.mindir +0 -19
  768. mindspore/ops/bprop_mindir/Greater_bprop.mindir +0 -19
  769. mindspore/ops/bprop_mindir/HSigmoid_bprop.mindir +0 -16
  770. mindspore/ops/bprop_mindir/HSwish_bprop.mindir +0 -16
  771. mindspore/ops/bprop_mindir/IOU_bprop.mindir +0 -19
  772. mindspore/ops/bprop_mindir/InstanceNorm_bprop.mindir +0 -0
  773. mindspore/ops/bprop_mindir/IsFinite_bprop.mindir +0 -15
  774. mindspore/ops/bprop_mindir/IsInf_bprop.mindir +0 -15
  775. mindspore/ops/bprop_mindir/IsNan_bprop.mindir +0 -15
  776. mindspore/ops/bprop_mindir/KLDivLoss_bprop.mindir +0 -126
  777. mindspore/ops/bprop_mindir/L2Loss_bprop.mindir +0 -15
  778. mindspore/ops/bprop_mindir/L2Normalize_bprop.mindir +0 -30
  779. mindspore/ops/bprop_mindir/LRN_bprop.mindir +0 -43
  780. mindspore/ops/bprop_mindir/LayerNormGrad_bprop.mindir +0 -0
  781. mindspore/ops/bprop_mindir/LessEqual_bprop.mindir +0 -19
  782. mindspore/ops/bprop_mindir/Less_bprop.mindir +0 -19
  783. mindspore/ops/bprop_mindir/LinSpace_bprop.mindir +0 -23
  784. mindspore/ops/bprop_mindir/Load_bprop.mindir +0 -13
  785. mindspore/ops/bprop_mindir/LogSoftmax_bprop.mindir +0 -23
  786. mindspore/ops/bprop_mindir/LogicalAnd_bprop.mindir +0 -19
  787. mindspore/ops/bprop_mindir/LogicalNot_bprop.mindir +0 -15
  788. mindspore/ops/bprop_mindir/MaskedSelect_bprop.mindir +0 -21
  789. mindspore/ops/bprop_mindir/MaxPool3DGradGrad_bprop.mindir +0 -74
  790. mindspore/ops/bprop_mindir/MaxPool3DGrad_bprop.mindir +0 -74
  791. mindspore/ops/bprop_mindir/MaxPool3D_bprop.mindir +0 -75
  792. mindspore/ops/bprop_mindir/MaxPoolGradGrad_bprop.mindir +0 -65
  793. mindspore/ops/bprop_mindir/MaxPoolWithArgmax_bprop.mindir +0 -0
  794. mindspore/ops/bprop_mindir/Maximum_bprop.mindir +0 -0
  795. mindspore/ops/bprop_mindir/Minimum_bprop.mindir +0 -0
  796. mindspore/ops/bprop_mindir/MirrorPad_bprop.mindir +0 -27
  797. mindspore/ops/bprop_mindir/Mish_bprop.mindir +0 -35
  798. mindspore/ops/bprop_mindir/MulNoNan_bprop.mindir +0 -0
  799. mindspore/ops/bprop_mindir/NLLLoss_bprop.mindir +0 -0
  800. mindspore/ops/bprop_mindir/NonZero_bprop.mindir +0 -14
  801. mindspore/ops/bprop_mindir/NotEqual_bprop.mindir +0 -19
  802. mindspore/ops/bprop_mindir/OneHot_bprop.mindir +0 -26
  803. mindspore/ops/bprop_mindir/OnesLike_bprop.mindir +0 -14
  804. mindspore/ops/bprop_mindir/PReLU_bprop.mindir +0 -0
  805. mindspore/ops/bprop_mindir/Pad_bprop.mindir +0 -0
  806. mindspore/ops/bprop_mindir/Padding_bprop.mindir +0 -0
  807. mindspore/ops/bprop_mindir/RNNTLoss_bprop.mindir +0 -29
  808. mindspore/ops/bprop_mindir/ROIAlign_bprop.mindir +0 -82
  809. mindspore/ops/bprop_mindir/Range_bprop.mindir +0 -22
  810. mindspore/ops/bprop_mindir/Rank_bprop.mindir +0 -14
  811. mindspore/ops/bprop_mindir/ReLU6_bprop.mindir +0 -16
  812. mindspore/ops/bprop_mindir/ReLUV2_bprop.mindir +0 -0
  813. mindspore/ops/bprop_mindir/ReduceAll_bprop.mindir +0 -19
  814. mindspore/ops/bprop_mindir/ReduceAny_bprop.mindir +0 -19
  815. mindspore/ops/bprop_mindir/ReluGrad_bprop.mindir +0 -20
  816. mindspore/ops/bprop_mindir/Reshape_bprop.mindir +0 -60
  817. mindspore/ops/bprop_mindir/ResizeBilinear_bprop.mindir +0 -29
  818. mindspore/ops/bprop_mindir/ResizeNearestNeighbor_bprop.mindir +0 -89
  819. mindspore/ops/bprop_mindir/ReverseSequence_bprop.mindir +0 -52
  820. mindspore/ops/bprop_mindir/ReverseV2_bprop.mindir +0 -22
  821. mindspore/ops/bprop_mindir/Round_bprop.mindir +0 -15
  822. mindspore/ops/bprop_mindir/ScatterMax_bprop.mindir +0 -0
  823. mindspore/ops/bprop_mindir/ScatterMin_bprop.mindir +0 -0
  824. mindspore/ops/bprop_mindir/ScatterNdUpdate_bprop.mindir +0 -22
  825. mindspore/ops/bprop_mindir/ScatterNd_bprop.mindir +0 -24
  826. mindspore/ops/bprop_mindir/ScatterNonAliasingAdd_bprop.mindir +0 -22
  827. mindspore/ops/bprop_mindir/ScatterUpdate_bprop.mindir +0 -0
  828. mindspore/ops/bprop_mindir/SeLU_bprop.mindir +0 -21
  829. mindspore/ops/bprop_mindir/Select_bprop.mindir +0 -31
  830. mindspore/ops/bprop_mindir/Shape_bprop.mindir +0 -14
  831. mindspore/ops/bprop_mindir/SigmoidCrossEntropyWithLogits_bprop.mindir +0 -21
  832. mindspore/ops/bprop_mindir/SigmoidGrad_bprop.mindir +0 -0
  833. mindspore/ops/bprop_mindir/Sigmoid_bprop.mindir +0 -16
  834. mindspore/ops/bprop_mindir/Sign_bprop.mindir +0 -15
  835. mindspore/ops/bprop_mindir/Slice_bprop.mindir +0 -26
  836. mindspore/ops/bprop_mindir/SmoothL1Loss_bprop.mindir +0 -36
  837. mindspore/ops/bprop_mindir/SoftmaxCrossEntropyWithLogits_bprop.mindir +0 -0
  838. mindspore/ops/bprop_mindir/Softplus_bprop.mindir +0 -16
  839. mindspore/ops/bprop_mindir/Softsign_bprop.mindir +0 -33
  840. mindspore/ops/bprop_mindir/Sort_bprop.mindir +0 -0
  841. mindspore/ops/bprop_mindir/SpaceToBatchND_bprop.mindir +0 -28
  842. mindspore/ops/bprop_mindir/SpaceToDepth_bprop.mindir +0 -23
  843. mindspore/ops/bprop_mindir/SparseGatherV2_bprop.mindir +0 -0
  844. mindspore/ops/bprop_mindir/SparseSoftmaxCrossEntropyWithLogits_bprop.mindir +0 -0
  845. mindspore/ops/bprop_mindir/Split_bprop.mindir +0 -22
  846. mindspore/ops/bprop_mindir/Squeeze_bprop.mindir +0 -54
  847. mindspore/ops/bprop_mindir/StridedSliceGrad_bprop.mindir +0 -95
  848. mindspore/ops/bprop_mindir/StridedSlice_bprop.mindir +0 -98
  849. mindspore/ops/bprop_mindir/Switch_bprop.mindir +0 -29
  850. mindspore/ops/bprop_mindir/TanhGrad_bprop.mindir +0 -0
  851. mindspore/ops/bprop_mindir/Tanh_bprop.mindir +0 -66
  852. mindspore/ops/bprop_mindir/TensorScatterAdd_bprop.mindir +0 -22
  853. mindspore/ops/bprop_mindir/TensorScatterUpdate_bprop.mindir +0 -29
  854. mindspore/ops/bprop_mindir/TensorShape_bprop.mindir +0 -14
  855. mindspore/ops/bprop_mindir/Tile_bprop.mindir +0 -0
  856. mindspore/ops/bprop_mindir/TopK_bprop.mindir +0 -0
  857. mindspore/ops/bprop_mindir/TransShape_bprop.mindir +0 -23
  858. mindspore/ops/bprop_mindir/TruncateDiv_bprop.mindir +0 -19
  859. mindspore/ops/bprop_mindir/TupleGetItem_bprop.mindir +0 -20
  860. mindspore/ops/bprop_mindir/Unique_bprop.mindir +0 -16
  861. mindspore/ops/bprop_mindir/Unstack_bprop.mindir +0 -22
  862. mindspore/ops/bprop_mindir/UpsampleNearest3D_bprop.mindir +0 -32
  863. mindspore/ops/bprop_mindir/UpsampleTrilinear3D_bprop.mindir +0 -38
  864. mindspore/ops/bprop_mindir/ZerosLike_bprop.mindir +0 -15
  865. mindspore/ops/bprop_mindir/generate_mindir.py +0 -114
  866. mindspore/rewrite/node_visitor.py +0 -44
  867. mindspore/rewrite/topological_manager.py +0 -203
  868. mindspore/scipy/sparse/linalg.py +0 -192
  869. {mindspore-2.0.0rc1.dist-info → mindspore-2.2.0.dist-info}/WHEEL +0 -0
  870. {mindspore-2.0.0rc1.dist-info → mindspore-2.2.0.dist-info}/top_level.txt +0 -0
@@ -151,7 +151,7 @@ class AdjustGamma(ImageTensorOperation):
151
151
  The output image pixel value is exponentially related to the input image pixel value.
152
152
  gamma larger than 1 make the shadows darker,
153
153
  while gamma smaller than 1 make dark regions lighter.
154
- gain (float, optional): The constant multiplier. Default: 1.0.
154
+ gain (float, optional): The constant multiplier. Default: ``1.0``.
155
155
 
156
156
  Raises:
157
157
  TypeError: If `gain` is not of type float.
@@ -186,7 +186,7 @@ class AutoAugment(ImageTensorOperation):
186
186
 
187
187
  Args:
188
188
  policy (AutoAugmentPolicy, optional): AutoAugment policies learned on different datasets.
189
- Default: AutoAugmentPolicy.IMAGENET.
189
+ Default: ``AutoAugmentPolicy.IMAGENET``.
190
190
  It can be any of [AutoAugmentPolicy.IMAGENET, AutoAugmentPolicy.CIFAR10, AutoAugmentPolicy.SVHN].
191
191
  Randomly apply 2 operations from a candidate set. See auto augmentation details in AutoAugmentPolicy.
192
192
 
@@ -196,21 +196,21 @@ class AutoAugment(ImageTensorOperation):
196
196
 
197
197
  - AutoAugmentPolicy.SVHN, means to apply AutoAugment learned on SVHN dataset.
198
198
 
199
- interpolation (Inter, optional): Image interpolation mode for Resize operation. Default: Inter.NEAREST.
200
- It can be any of [Inter.NEAREST, Inter.BILINEAR, Inter.BICUBIC, Inter.AREA].
199
+ interpolation (Inter, optional): Image interpolation mode for Resize operation. Default: ``Inter.NEAREST``.
200
+ It can be ``Inter.NEAREST``, ``Inter.BILINEAR``, ``Inter.BICUBIC``, ``Inter.AREA``.
201
201
 
202
- - Inter.NEAREST: means interpolation method is nearest-neighbor interpolation.
202
+ - ``Inter.NEAREST`` : means interpolation method is nearest-neighbor interpolation.
203
203
 
204
- - Inter.BILINEAR: means interpolation method is bilinear interpolation.
204
+ - ``Inter.BILINEA`` : means interpolation method is bilinear interpolation.
205
205
 
206
- - Inter.BICUBIC: means the interpolation method is bicubic interpolation.
206
+ - ``Inter.BICUBIC`` : means the interpolation method is bicubic interpolation.
207
207
 
208
- - Inter.AREA: means the interpolation method is pixel area interpolation.
208
+ - ``Inter.AREA`` : means the interpolation method is pixel area interpolation.
209
209
 
210
210
  fill_value (Union[int, tuple], optional): Pixel fill value for the area outside the transformed image.
211
211
  It can be an int or a 3-tuple. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
212
- If it is an integer, it is used for all RGB channels. The fill_value values must be in range [0, 255].
213
- Default: 0.
212
+ If it is an integer, it is used for all RGB channels. The `fill_value` values must be in range [0, 255].
213
+ Default: ``0``.
214
214
 
215
215
  Raises:
216
216
  TypeError: If `policy` is not of type AutoAugmentPolicy.
@@ -252,9 +252,9 @@ class AutoContrast(ImageTensorOperation):
252
252
 
253
253
  Args:
254
254
  cutoff (float, optional): Percent of lightest and darkest pixels to cut off from
255
- the histogram of input image. The value must be in the range [0.0, 50.0). Default: 0.0.
255
+ the histogram of input image. The value must be in the range [0.0, 50.0). Default: ``0.0``.
256
256
  ignore (Union[int, sequence], optional): The background pixel values to ignore,
257
- The ignore values must be in range [0, 255]. Default: None.
257
+ The ignore values must be in range [0, 255]. Default: ``None``.
258
258
 
259
259
  Raises:
260
260
  TypeError: If `cutoff` is not of type float.
@@ -294,7 +294,7 @@ class BoundingBoxAugment(ImageTensorOperation):
294
294
  transform (TensorOperation): C++ transformation operation to be applied on random selection
295
295
  of bounding box regions of a given image.
296
296
  ratio (float, optional): Ratio of bounding boxes to apply augmentation on.
297
- Range: [0.0, 1.0]. Default: 0.3.
297
+ Range: [0.0, 1.0]. Default: ``0.3``.
298
298
 
299
299
  Raises:
300
300
  TypeError: If `transform` is not an image processing operation
@@ -493,10 +493,11 @@ class CutMixBatch(ImageTensorOperation):
493
493
  Note that you need to make labels into one-hot format and batched before calling this operation.
494
494
 
495
495
  Args:
496
- image_batch_format (ImageBatchFormat): The method of padding. Can be any of
497
- [ImageBatchFormat.NHWC, ImageBatchFormat.NCHW].
498
- alpha (float, optional): Hyperparameter of beta distribution, must be larger than 0. Default: 1.0.
499
- prob (float, optional): The probability by which CutMix is applied to each image, range: [0, 1]. Default: 1.0.
496
+ image_batch_format (ImageBatchFormat): The method of padding. Can be
497
+ ``ImageBatchFormat.NHWC``, ``ImageBatchFormat.NCHW``.
498
+ alpha (float, optional): Hyperparameter of beta distribution, must be larger than 0. Default: ``1.0``.
499
+ prob (float, optional): The probability by which CutMix is applied to each image, range: [0, 1].
500
+ Default: ``1.0``.
500
501
 
501
502
  Raises:
502
503
  TypeError: If `image_batch_format` is not of type :class:`mindspore.dataset.vision.ImageBatchFormat` .
@@ -537,7 +538,8 @@ class CutOut(ImageTensorOperation):
537
538
 
538
539
  Args:
539
540
  length (int): The side length of each square patch, must be larger than 0.
540
- num_patches (int, optional): Number of patches to be cut out of an image, must be larger than 0. Default: 1.
541
+ num_patches (int, optional): Number of patches to be cut out of an image, must be larger than 0.
542
+ Default: ``1``.
541
543
 
542
544
  Raises:
543
545
  TypeError: If `length` is not of type int.
@@ -570,11 +572,11 @@ class Decode(ImageTensorOperation):
570
572
  Decode the input image.
571
573
 
572
574
  Args:
573
- rgb (bool, optional): Mode of decoding input image. Default: True.
574
- If True means format of decoded image is RGB else BGR (deprecated).
575
+ rgb (bool, optional): Mode of decoding input image. Default: ``True``.
576
+ If ``True`` means format of decoded image is RGB else BGR (deprecated).
575
577
 
576
578
  Raises:
577
- RuntimeError: If `rgb` is False, since this option is deprecated.
579
+ RuntimeError: If `rgb` is ``False``, since this option is deprecated.
578
580
  RuntimeError: If given tensor is not a 1D sequence.
579
581
 
580
582
  Supported Platforms:
@@ -608,7 +610,8 @@ class Decode(ImageTensorOperation):
608
610
  return super().__call__(img)
609
611
 
610
612
  def parse(self):
611
- return cde.DecodeOperation(self.rgb)
613
+ # deprecated api just support cpu device target
614
+ return cde.DecodeOperation(self.rgb, "CPU")
612
615
 
613
616
 
614
617
  class Equalize(ImageTensorOperation):
@@ -644,9 +647,10 @@ class GaussianBlur(ImageTensorOperation):
644
647
  If only an integer is provided, the kernel size will be (kernel_size, kernel_size). If a sequence of integer
645
648
  is provided, it must be a sequence of 2 values which represents (width, height).
646
649
  sigma (Union[float, Sequence[float]], optional): Standard deviation of the Gaussian kernel to use.
647
- Default: None. The value must be positive. If only a float is provided, the sigma will be (sigma, sigma).
650
+ Default: ``None``. The value must be positive. If only a float is provided,
651
+ the sigma will be (sigma, sigma).
648
652
  If a sequence of float is provided, it must be a sequence of 2 values which represents (width, height).
649
- If None is provided, the sigma will be calculated as ((kernel_size - 1) * 0.5 - 1) * 0.3 + 0.8.
653
+ If ``None`` is provided, the sigma will be calculated as ((kernel_size - 1) * 0.5 - 1) * 0.3 + 0.8.
650
654
 
651
655
  Raises:
652
656
  TypeError: If `kernel_size` is not of type int or Sequence[int].
@@ -771,7 +775,7 @@ class MixUpBatch(ImageTensorOperation):
771
775
  Note that you need to make labels into one-hot format and batched before calling this operation.
772
776
 
773
777
  Args:
774
- alpha (float, optional): Hyperparameter of beta distribution. The value must be positive. Default: 1.0.
778
+ alpha (float, optional): Hyperparameter of beta distribution. The value must be positive. Default: ``1.0``.
775
779
 
776
780
  Raises:
777
781
  TypeError: If `alpha` is not of type float.
@@ -839,7 +843,8 @@ class Normalize(ImageTensorOperation):
839
843
  self.std = std
840
844
 
841
845
  def parse(self):
842
- return cde.NormalizeOperation(self.mean, self.std, True)
846
+ # deprecated api just support cpu device target
847
+ return cde.NormalizeOperation(self.mean, self.std, True, "CPU")
843
848
 
844
849
 
845
850
  class NormalizePad(ImageTensorOperation):
@@ -851,7 +856,7 @@ class NormalizePad(ImageTensorOperation):
851
856
  The mean values must be in range (0.0, 255.0].
852
857
  std (sequence): List or tuple of standard deviations for each channel, with respect to channel order.
853
858
  The standard deviation values must be in range (0.0, 255.0].
854
- dtype (str, optional): Set the dtype of the output image. Default: "float32".
859
+ dtype (str, optional): Set the dtype of the output image. Default: ``"float32"``.
855
860
 
856
861
  Raises:
857
862
  TypeError: If `mean` is not of type sequence.
@@ -897,20 +902,20 @@ class Pad(ImageTensorOperation):
897
902
  If 4 values are provided as a list or tuple, it pads the left, top, right and bottom respectively.
898
903
  The pad values must be non-negative.
899
904
  fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
900
- padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
901
- If it is an integer, it is used for all RGB channels.
902
- The fill_value values must be in range [0, 255]. Default: 0.
903
- padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. Can be any of
904
- [Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
905
+ `padding_mode` ``Border.CONSTANT``. If it is a 3-tuple, it is used to fill R, G, B
906
+ channels respectively. If it is an integer, it is used for all RGB channels.
907
+ The `fill_value` values must be in range [0, 255]. Default: ``0``.
908
+ padding_mode (Border, optional): The method of padding. Default: ``Border.CONSTANT``. Can be
909
+ ``Border.CONSTANT``, ``Border.EDGE``, ``Border.REFLECT``, ``Border.SYMMETRIC``.
905
910
 
906
- - Border.CONSTANT, means it fills the border with constant values.
911
+ - ``Border.CONSTANT`` , means it fills the border with constant values.
907
912
 
908
- - Border.EDGE, means it pads with the last value on the edge.
913
+ - ``Border.EDGE`` , means it pads with the last value on the edge.
909
914
 
910
- - Border.REFLECT, means it reflects the values on the edge omitting the last
915
+ - ``Border.REFLECT`` , means it reflects the values on the edge omitting the last
911
916
  value of edge.
912
917
 
913
- - Border.SYMMETRIC, means it reflects the values on the edge repeating the last
918
+ - ``Border.SYMMETRIC`` , means it reflects the values on the edge repeating the last
914
919
  value of edge.
915
920
 
916
921
  Note:
@@ -956,10 +961,10 @@ class RandomAdjustSharpness(ImageTensorOperation):
956
961
 
957
962
  Args:
958
963
  degree (float): Sharpness adjustment degree, which must be non negative.
959
- Degree of 0.0 gives a blurred image, degree of 1.0 gives the original image,
960
- and degree of 2.0 increases the sharpness by a factor of 2.
964
+ Degree of ``0.0`` gives a blurred image, degree of ``1.0`` gives the original image,
965
+ and degree of ``2.0`` increases the sharpness by a factor of 2.
961
966
  prob (float, optional): Probability of the image being sharpness adjusted, which
962
- must be in range of [0, 1]. Default: 0.5.
967
+ must be in range of [0, 1]. Default: ``0.5``.
963
968
 
964
969
  Raises:
965
970
  TypeError: If `degree` is not of type float.
@@ -996,7 +1001,7 @@ class RandomAffine(ImageTensorOperation):
996
1001
  If `degrees` is a number, the range will be (-degrees, degrees).
997
1002
  If `degrees` is a sequence, it should be (min, max).
998
1003
  translate (sequence, optional): Sequence (tx_min, tx_max, ty_min, ty_max) of minimum/maximum translation in
999
- x(horizontal) and y(vertical) directions, range [-1.0, 1.0]. Default: None.
1004
+ x(horizontal) and y(vertical) directions, range [-1.0, 1.0]. Default: ``None``.
1000
1005
  The horizontal and vertical shift is selected randomly from the range:
1001
1006
  (tx_min*width, tx_max*width) and (ty_min*height, ty_max*height), respectively.
1002
1007
  If a tuple or list of size 2, then a translate parallel to the X axis in the range of
@@ -1004,30 +1009,31 @@ class RandomAffine(ImageTensorOperation):
1004
1009
  If a tuple or list of size 4, then a translate parallel to the X axis in the range of
1005
1010
  (translate[0], translate[1]) and a translate parallel to the Y axis in the range of
1006
1011
  (translate[2], translate[3]) are applied.
1007
- If None, no translation is applied.
1012
+ If ``None``, no translation is applied.
1008
1013
  scale (sequence, optional): Scaling factor interval, which must be non negative.
1009
- Default: None, original scale is used.
1010
- shear (Union[int, float, sequence], optional): Range of shear factor, which must be positive. Default: None.
1014
+ Default: ``None``, original scale is used.
1015
+ shear (Union[int, float, sequence], optional): Range of shear factor, which must be positive.
1016
+ Default: ``None``.
1011
1017
  If a number, then a shear parallel to the X axis in the range of (-shear, +shear) is applied.
1012
1018
  If a tuple or list of size 2, then a shear parallel to the X axis in the range of (shear[0], shear[1])
1013
1019
  is applied.
1014
1020
  If a tuple or list of size 4, then a shear parallel to X axis in the range of (shear[0], shear[1])
1015
1021
  and a shear parallel to Y axis in the range of (shear[2], shear[3]) is applied.
1016
1022
  If None, no shear is applied.
1017
- resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
1018
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA].
1023
+ resample (Inter, optional): An optional resampling filter. Default: ``Inter.NEAREST``.
1024
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``, ``Inter.AREA``.
1019
1025
 
1020
- - Inter.BILINEAR, means resample method is bilinear interpolation.
1026
+ - ``Inter.BILINEA`` , means resample method is bilinear interpolation.
1021
1027
 
1022
- - Inter.NEAREST, means resample method is nearest-neighbor interpolation.
1028
+ - ``Inter.NEAREST`` , means resample method is nearest-neighbor interpolation.
1023
1029
 
1024
- - Inter.BICUBIC, means resample method is bicubic interpolation.
1030
+ - ``Inter.BICUBIC`` , means resample method is bicubic interpolation.
1025
1031
 
1026
- - Inter.AREA, means resample method is pixel area interpolation.
1032
+ - ``Inter.AREA`` :, means resample method is pixel area interpolation.
1027
1033
 
1028
1034
  fill_value (Union[int, tuple[int]], optional): Optional fill_value to fill the area outside the transform
1029
1035
  in the output image. There must be three elements in tuple and the value of single element is [0, 255].
1030
- Default: 0, filling is performed.
1036
+ Default: ``0``, filling is performed.
1031
1037
 
1032
1038
  Raises:
1033
1039
  TypeError: If `degrees` is not of type int, float or sequence.
@@ -1106,11 +1112,11 @@ class RandomAutoContrast(ImageTensorOperation):
1106
1112
 
1107
1113
  Args:
1108
1114
  cutoff (float, optional): Percent of the lightest and darkest pixels to be cut off from
1109
- the histogram of the input image. The value must be in range of [0.0, 50.0). Default: 0.0.
1115
+ the histogram of the input image. The value must be in range of [0.0, 50.0). Default: ``0.0``.
1110
1116
  ignore (Union[int, sequence], optional): The background pixel values to be ignored, each of
1111
- which must be in range of [0, 255]. Default: None.
1117
+ which must be in range of [0, 255]. Default: ``None``.
1112
1118
  prob (float, optional): Probability of the image being automatically contrasted, which
1113
- must be in range of [0, 1]. Default: 0.5.
1119
+ must be in range of [0, 1]. Default: ``0.5``.
1114
1120
 
1115
1121
  Raises:
1116
1122
  TypeError: If `cutoff` is not of type float.
@@ -1153,7 +1159,7 @@ class RandomColor(ImageTensorOperation):
1153
1159
  Args:
1154
1160
  degrees (Sequence[float], optional): Range of random color adjustment degrees, which must be non-negative.
1155
1161
  It should be in (min, max) format. If min=max, then it is a
1156
- single fixed magnitude operation. Default: (0.1, 1.9).
1162
+ single fixed magnitude operation. Default: ``(0.1, 1.9)``.
1157
1163
 
1158
1164
  Raises:
1159
1165
  TypeError: If `degrees` is not of type Sequence[float].
@@ -1186,19 +1192,19 @@ class RandomColorAdjust(ImageTensorOperation):
1186
1192
  This operation supports running on Ascend or GPU platforms by Offload.
1187
1193
 
1188
1194
  Args:
1189
- brightness (Union[float, Sequence[float]], optional): Brightness adjustment factor. Default: (1, 1).
1195
+ brightness (Union[float, Sequence[float]], optional): Brightness adjustment factor. Default: ``(1, 1)``.
1190
1196
  Cannot be negative.
1191
1197
  If it is a float, the factor is uniformly chosen from the range [max(0, 1-brightness), 1+brightness].
1192
1198
  If it is a sequence, it should be [min, max] for the range.
1193
- contrast (Union[float, Sequence[float]], optional): Contrast adjustment factor. Default: (1, 1).
1199
+ contrast (Union[float, Sequence[float]], optional): Contrast adjustment factor. Default: ``(1, 1)``.
1194
1200
  Cannot be negative.
1195
1201
  If it is a float, the factor is uniformly chosen from the range [max(0, 1-contrast), 1+contrast].
1196
1202
  If it is a sequence, it should be [min, max] for the range.
1197
- saturation (Union[float, Sequence[float]], optional): Saturation adjustment factor. Default: (1, 1).
1203
+ saturation (Union[float, Sequence[float]], optional): Saturation adjustment factor. Default: ``(1, 1)``.
1198
1204
  Cannot be negative.
1199
1205
  If it is a float, the factor is uniformly chosen from the range [max(0, 1-saturation), 1+saturation].
1200
1206
  If it is a sequence, it should be [min, max] for the range.
1201
- hue (Union[float, Sequence[float]], optional): Hue adjustment factor. Default: (0, 0).
1207
+ hue (Union[float, Sequence[float]], optional): Hue adjustment factor. Default: ``(0, 0)``.
1202
1208
  If it is a float, the range will be [-hue, hue]. Value should be 0 <= hue <= 0.5.
1203
1209
  If it is a sequence, it should be [min, max] where -0.5 <= min <= max <= 0.5.
1204
1210
 
@@ -1266,30 +1272,30 @@ class RandomCrop(ImageTensorOperation):
1266
1272
  If size is an integer, a square crop of size (size, size) is returned.
1267
1273
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
1268
1274
  padding (Union[int, Sequence[int]], optional): The number of pixels to pad each border of the image.
1269
- The padding value(s) must be non-negative. Default: None.
1270
- If padding is not None, pad image first with padding values.
1275
+ The padding value(s) must be non-negative. Default: ``None``.
1276
+ If `padding` is not ``None``, pad image first with padding values.
1271
1277
  If a single number is provided, pad all borders with this value.
1272
1278
  If a tuple or lists of 2 values are provided, pad the (left and top)
1273
1279
  with the first value and (right and bottom) with the second value.
1274
1280
  If 4 values are provided as a list or tuple,
1275
1281
  pad the left, top, right and bottom respectively.
1276
1282
  pad_if_needed (bool, optional): Pad the image if either side is smaller than
1277
- the given output size. Default: False.
1283
+ the given output size. Default: ``False``.
1278
1284
  fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
1279
- padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
1285
+ `padding_mode` ``Border.CONSTANT``. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
1280
1286
  If it is an integer, it is used for all RGB channels.
1281
- The fill_value values must be in range [0, 255]. Default: 0.
1282
- padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. It can be any of
1283
- [Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
1287
+ The fill_value values must be in range [0, 255]. Default: ``0``.
1288
+ padding_mode (Border, optional): The method of padding. Default: ``Border.CONSTANT``. It can be
1289
+ ``Border.CONSTANT``, ``Border.EDGE``, ``Border.REFLECT``, ``Border.SYMMETRIC``.
1284
1290
 
1285
- - Border.CONSTANT, means it fills the border with constant values.
1291
+ - ``Border.CONSTANT`` , means it fills the border with constant values.
1286
1292
 
1287
- - Border.EDGE, means it pads with the last value on the edge.
1293
+ - ``Border.EDGE`` , means it pads with the last value on the edge.
1288
1294
 
1289
- - Border.REFLECT, means it reflects the values on the edge omitting the last
1295
+ - ``Border.REFLECT`` , means it reflects the values on the edge omitting the last
1290
1296
  value of edge.
1291
1297
 
1292
- - Border.SYMMETRIC, means it reflects the values on the edge repeating the last
1298
+ - ``Border.SYMMETRIC`` , means it reflects the values on the edge repeating the last
1293
1299
  value of edge.
1294
1300
 
1295
1301
  Note:
@@ -1354,25 +1360,25 @@ class RandomCropDecodeResize(ImageTensorOperation):
1354
1360
  If size is an integer, a square crop of size (size, size) is returned.
1355
1361
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
1356
1362
  scale (Union[list, tuple], optional): Range [min, max) of respective size of the
1357
- original size to be cropped, which must be non-negative. Default: (0.08, 1.0).
1363
+ original size to be cropped, which must be non-negative. Default: ``(0.08, 1.0)``.
1358
1364
  ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
1359
- cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
1360
- interpolation (Inter, optional): Image interpolation mode for resize operation. Default: Inter.BILINEAR.
1361
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
1365
+ cropped, which must be non-negative. Default: ``(3. / 4., 4. / 3.)``.
1366
+ interpolation (Inter, optional): Image interpolation mode for resize operation. Default: ``Inter.BILINEAR``.
1367
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``, ``Inter.AREA``, ``Inter.PILCUBIC``.
1362
1368
 
1363
- - Inter.BILINEAR, means interpolation method is bilinear interpolation.
1369
+ - ``Inter.BILINEA`` , means interpolation method is bilinear interpolation.
1364
1370
 
1365
- - Inter.NEAREST, means interpolation method is nearest-neighbor interpolation.
1371
+ - ``Inter.NEAREST`` , means interpolation method is nearest-neighbor interpolation.
1366
1372
 
1367
- - Inter.BICUBIC, means interpolation method is bicubic interpolation.
1373
+ - ``Inter.BICUBIC`` , means interpolation method is bicubic interpolation.
1368
1374
 
1369
- - Inter.AREA, means interpolation method is pixel area interpolation.
1375
+ - ``Inter.AREA`` :, means interpolation method is pixel area interpolation.
1370
1376
 
1371
- - Inter.PILCUBIC, means interpolation method is bicubic interpolation like implemented in pillow, input
1377
+ - ``Inter.PILCUBIC`` , means interpolation method is bicubic interpolation like implemented in pillow, input
1372
1378
  should be in 3 channels format.
1373
1379
 
1374
- max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: 10.
1375
- If exceeded, fall back to use center_crop instead. The max_attempts value must be positive.
1380
+ max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: ``10``.
1381
+ If exceeded, fall back to use center_crop instead. The `max_attempts` value must be positive.
1376
1382
 
1377
1383
  Raises:
1378
1384
  TypeError: If `size` is not of type int or Sequence[int].
@@ -1436,29 +1442,29 @@ class RandomCropWithBBox(ImageTensorOperation):
1436
1442
  If size is an integer, a square crop of size (size, size) is returned.
1437
1443
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
1438
1444
  padding (Union[int, Sequence[int]], optional): The number of pixels to pad the image
1439
- The padding value(s) must be non-negative. Default: None.
1440
- If padding is not None, first pad image with padding values.
1445
+ The padding value(s) must be non-negative. Default: ``None``.
1446
+ If `padding` is not ``None``, first pad image with padding values.
1441
1447
  If a single number is provided, pad all borders with this value.
1442
1448
  If a tuple or lists of 2 values are provided, pad the (left and top)
1443
1449
  with the first value and (right and bottom) with the second value.
1444
1450
  If 4 values are provided as a list or tuple, pad the left, top, right and bottom respectively.
1445
1451
  pad_if_needed (bool, optional): Pad the image if either side is smaller than
1446
- the given output size. Default: False.
1452
+ the given output size. Default: ``False``.
1447
1453
  fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
1448
- padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
1454
+ `padding_mode` ``Border.CONSTANT``. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
1449
1455
  If it is an integer, it is used for all RGB channels.
1450
- The fill_value values must be in range [0, 255]. Default: 0.
1451
- padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. It can be any of
1452
- [Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
1456
+ The fill_value values must be in range [0, 255]. Default: ``0``.
1457
+ padding_mode (Border, optional): The method of padding. Default: ``Border.CONSTANT``. It can be any of
1458
+ ``Border.CONSTANT``, ``Border.EDGE``, ``Border.REFLECT``, ``Border.SYMMETRIC``.
1453
1459
 
1454
- - Border.CONSTANT, means it fills the border with constant values.
1460
+ - ``Border.CONSTANT`` , means it fills the border with constant values.
1455
1461
 
1456
- - Border.EDGE, means it pads with the last value on the edge.
1462
+ - ``Border.EDGE`` , means it pads with the last value on the edge.
1457
1463
 
1458
- - Border.REFLECT, means it reflects the values on the edge omitting the last
1464
+ - ``Border.REFLECT`` , means it reflects the values on the edge omitting the last
1459
1465
  value of edge.
1460
1466
 
1461
- - Border.SYMMETRIC, means it reflects the values on the edge repeating the last
1467
+ - ``Border.SYMMETRIC`` , means it reflects the values on the edge repeating the last
1462
1468
  value of edge.
1463
1469
 
1464
1470
  Note:
@@ -1520,7 +1526,7 @@ class RandomEqualize(ImageTensorOperation):
1520
1526
 
1521
1527
  Args:
1522
1528
  prob (float, optional): Probability of the image being equalized, which
1523
- must be in range of [0, 1]. Default: 0.5.
1529
+ must be in range of [0, 1]. Default: ``0.5``.
1524
1530
 
1525
1531
  Raises:
1526
1532
  TypeError: If `prob` is not of type float.
@@ -1553,7 +1559,8 @@ class RandomHorizontalFlip(ImageTensorOperation):
1553
1559
  This operation supports running on Ascend or GPU platforms by Offload.
1554
1560
 
1555
1561
  Args:
1556
- prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]. Default: 0.5.
1562
+ prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1].
1563
+ Default: ``0.5``.
1557
1564
 
1558
1565
  Raises:
1559
1566
  TypeError: If `prob` is not of type float.
@@ -1583,7 +1590,8 @@ class RandomHorizontalFlipWithBBox(ImageTensorOperation):
1583
1590
  Flip the input image horizontally randomly with a given probability and adjust bounding boxes accordingly.
1584
1591
 
1585
1592
  Args:
1586
- prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]. Default: 0.5.
1593
+ prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1].
1594
+ Default: ``0.5``.
1587
1595
 
1588
1596
  Raises:
1589
1597
  TypeError: If `prob` is not of type float.
@@ -1613,7 +1621,8 @@ class RandomInvert(ImageTensorOperation):
1613
1621
  Randomly invert the colors of image with a given probability.
1614
1622
 
1615
1623
  Args:
1616
- prob (float, optional): Probability of the image being inverted, which must be in range of [0, 1]. Default: 0.5.
1624
+ prob (float, optional): Probability of the image being inverted, which must be in range of [0, 1].
1625
+ Default: ``0.5``.
1617
1626
 
1618
1627
  Raises:
1619
1628
  TypeError: If `prob` is not of type float.
@@ -1644,7 +1653,7 @@ class RandomLighting(ImageTensorOperation):
1644
1653
  calculated from the imagenet dataset.
1645
1654
 
1646
1655
  Args:
1647
- alpha (float, optional): Intensity of the image, which must be non-negative. Default: 0.05.
1656
+ alpha (float, optional): Intensity of the image, which must be non-negative. Default: ``0.05``.
1648
1657
 
1649
1658
  Raises:
1650
1659
  TypeError: If `alpha` is not of type float.
@@ -1678,7 +1687,7 @@ class RandomPosterize(ImageTensorOperation):
1678
1687
  Bits values must be in range of [1,8], and include at
1679
1688
  least one integer value in the given range. It must be in
1680
1689
  (min, max) or integer format. If min=max, then it is a single fixed
1681
- magnitude operation. Default: (8, 8).
1690
+ magnitude operation. Default: ``(8, 8)``.
1682
1691
 
1683
1692
  Raises:
1684
1693
  TypeError: If `bits` is not of type int or sequence of int.
@@ -1718,25 +1727,25 @@ class RandomResizedCrop(ImageTensorOperation):
1718
1727
  If size is an integer, a square of size (size, size) will be cropped with this value.
1719
1728
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
1720
1729
  scale (Union[list, tuple], optional): Range [min, max) of respective size of the original
1721
- size to be cropped, which must be non-negative. Default: (0.08, 1.0).
1730
+ size to be cropped, which must be non-negative. Default: ``(0.08, 1.0)``.
1722
1731
  ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
1723
- cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
1724
- interpolation (Inter, optional): Method of interpolation. Default: Inter.BILINEAR.
1725
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
1732
+ cropped, which must be non-negative. Default: ``(3. / 4., 4. / 3.)``.
1733
+ interpolation (Inter, optional): Method of interpolation. Default: ``Inter.BILINEAR``.
1734
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``, ``Inter.AREA``, ``Inter.PILCUBIC``.
1726
1735
 
1727
- - Inter.BILINEAR, means interpolation method is bilinear interpolation.
1736
+ - ``Inter.BILINEA`` , means interpolation method is bilinear interpolation.
1728
1737
 
1729
- - Inter.NEAREST, means interpolation method is nearest-neighbor interpolation.
1738
+ - ``Inter.NEAREST`` , means interpolation method is nearest-neighbor interpolation.
1730
1739
 
1731
- - Inter.BICUBIC, means interpolation method is bicubic interpolation.
1740
+ - ``Inter.BICUBIC`` , means interpolation method is bicubic interpolation.
1732
1741
 
1733
- - Inter.AREA, means interpolation method is pixel area interpolation.
1742
+ - ``Inter.AREA`` :, means interpolation method is pixel area interpolation.
1734
1743
 
1735
- - Inter.PILCUBIC, means interpolation method is bicubic interpolation like implemented in pillow, input
1736
- should be in 3 channels format.
1744
+ - ``Inter.PILCUBIC`` , means interpolation method is bicubic interpolation like implemented in pillow,
1745
+ input should be in 3 channels format.
1737
1746
 
1738
1747
  max_attempts (int, optional): The maximum number of attempts to propose a valid
1739
- crop_area. Default: 10. If exceeded, fall back to use center_crop instead.
1748
+ crop_area. Default: ``10``. If exceeded, fall back to use center_crop instead.
1740
1749
 
1741
1750
  Raises:
1742
1751
  TypeError: If `size` is not of type int or Sequence[int].
@@ -1789,20 +1798,20 @@ class RandomResizedCropWithBBox(ImageTensorOperation):
1789
1798
  If size is an integer, a square of size (size, size) will be cropped with this value.
1790
1799
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
1791
1800
  scale (Union[list, tuple], optional): Range (min, max) of respective size of the original
1792
- size to be cropped, which must be non-negative. Default: (0.08, 1.0).
1801
+ size to be cropped, which must be non-negative. Default: ``(0.08, 1.0)``.
1793
1802
  ratio (Union[list, tuple], optional): Range (min, max) of aspect ratio to be
1794
- cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
1795
- interpolation (Inter mode, optional): Method of interpolation. Default: Inter.BILINEAR.
1796
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC] .
1803
+ cropped, which must be non-negative. Default: ``(3. / 4., 4. / 3.)``.
1804
+ interpolation (Inter mode, optional): Method of interpolation. Default: ``Inter.BILINEAR``.
1805
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC`` .
1797
1806
 
1798
- - Inter.BILINEAR, means interpolation method is bilinear interpolation.
1807
+ - ``Inter.BILINEA`` , means interpolation method is bilinear interpolation.
1799
1808
 
1800
- - Inter.NEAREST, means interpolation method is nearest-neighbor interpolation.
1809
+ - ``Inter.NEAREST`` , means interpolation method is nearest-neighbor interpolation.
1801
1810
 
1802
- - Inter.BICUBIC, means interpolation method is bicubic interpolation.
1811
+ - ``Inter.BICUBIC`` , means interpolation method is bicubic interpolation.
1803
1812
 
1804
1813
  max_attempts (int, optional): The maximum number of attempts to propose a valid
1805
- crop area. Default: 10. If exceeded, fall back to use center crop instead.
1814
+ crop area. Default: ``10``. If exceeded, fall back to use center crop instead.
1806
1815
 
1807
1816
  Raises:
1808
1817
  TypeError: If `size` is not of type int or Sequence[int].
@@ -1934,27 +1943,27 @@ class RandomRotation(ImageTensorOperation):
1934
1943
  degrees (Union[int, float, sequence]): Range of random rotation degrees.
1935
1944
  If `degrees` is a number, the range will be converted to (-degrees, degrees).
1936
1945
  If `degrees` is a sequence, it should be (min, max).
1937
- resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
1938
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA].
1946
+ resample (Inter, optional): An optional resampling filter. Default: ``Inter.NEAREST``.
1947
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``, ``Inter.AREA``.
1939
1948
 
1940
- - Inter.BILINEAR, means resample method is bilinear interpolation.
1949
+ - ``Inter.BILINEA`` , means resample method is bilinear interpolation.
1941
1950
 
1942
- - Inter.NEAREST, means resample method is nearest-neighbor interpolation.
1951
+ - ``Inter.NEAREST`` , means resample method is nearest-neighbor interpolation.
1943
1952
 
1944
- - Inter.BICUBIC, means resample method is bicubic interpolation.
1953
+ - ``Inter.BICUBIC`` , means resample method is bicubic interpolation.
1945
1954
 
1946
- - Inter.AREA: means the interpolation method is pixel area interpolation.
1955
+ - ``Inter.AREA`` : means the interpolation method is pixel area interpolation.
1947
1956
 
1948
- expand (bool, optional): Optional expansion flag. Default: False. If set to True, expand the output
1957
+ expand (bool, optional): Optional expansion flag. Default: ``False``. If set to ``True``, expand the output
1949
1958
  image to make it large enough to hold the entire rotated image.
1950
- If set to False or omitted, make the output image the same size as the input.
1959
+ If set to ``False`` or omitted, make the output image the same size as the input.
1951
1960
  Note that the expand flag assumes rotation around the center and no translation.
1952
- center (tuple, optional): Optional center of rotation (a 2-tuple). Default: None.
1953
- Origin is the top left corner. None sets to the center of the image.
1961
+ center (tuple, optional): Optional center of rotation (a 2-tuple). Default: ``None``.
1962
+ Origin is the top left corner. ``None`` sets to the center of the image.
1954
1963
  fill_value (Union[int, tuple[int]], optional): Optional fill color for the area outside the rotated image.
1955
1964
  If it is a 3-tuple, it is used to fill R, G, B channels respectively.
1956
1965
  If it is an integer, it is used for all RGB channels.
1957
- The fill_value values must be in range [0, 255]. Default: 0.
1966
+ The fill_value values must be in range [0, 255]. Default: ``0``.
1958
1967
 
1959
1968
  Raises:
1960
1969
  TypeError: If `degrees` is not of type int, float or sequence.
@@ -2062,7 +2071,7 @@ class RandomSharpness(ImageTensorOperation):
2062
2071
  Args:
2063
2072
  degrees (Union[list, tuple], optional): Range of random sharpness adjustment degrees,
2064
2073
  which must be non-negative. It should be in (min, max) format. If min=max, then
2065
- it is a single fixed magnitude operation. Default: (0.1, 1.9).
2074
+ it is a single fixed magnitude operation. Default: ``(0.1, 1.9)``.
2066
2075
 
2067
2076
  Raises:
2068
2077
  TypeError : If `degrees` is not of type list or tuple.
@@ -2093,7 +2102,7 @@ class RandomSolarize(ImageTensorOperation):
2093
2102
  the subrange to (255 - pixel).
2094
2103
 
2095
2104
  Args:
2096
- threshold (tuple, optional): Range of random solarize threshold. Default: (0, 255).
2105
+ threshold (tuple, optional): Range of random solarize threshold. Default: ``(0, 255)``.
2097
2106
  Threshold values should always be in (min, max) format,
2098
2107
  where min and max are integers in the range [0, 255], and min <= max.
2099
2108
  If min=max, then invert all pixel values above min(max).
@@ -2128,7 +2137,7 @@ class RandomVerticalFlip(ImageTensorOperation):
2128
2137
  This operation supports running on Ascend or GPU platforms by Offload.
2129
2138
 
2130
2139
  Args:
2131
- prob (float, optional): Probability of the image being flipped. Default: 0.5.
2140
+ prob (float, optional): Probability of the image being flipped. Default: ``0.5``.
2132
2141
 
2133
2142
  Raises:
2134
2143
  TypeError: If `prob` is not of type float.
@@ -2158,7 +2167,7 @@ class RandomVerticalFlipWithBBox(ImageTensorOperation):
2158
2167
  Flip the input image vertically, randomly with a given probability and adjust bounding boxes accordingly.
2159
2168
 
2160
2169
  Args:
2161
- prob (float, optional): Probability of the image being flipped. Default: 0.5.
2170
+ prob (float, optional): Probability of the image being flipped. Default: ``0.5``.
2162
2171
 
2163
2172
  Raises:
2164
2173
  TypeError: If `prob` is not of type float.
@@ -2227,18 +2236,18 @@ class Resize(ImageTensorOperation):
2227
2236
  If size is an integer, the smaller edge of the image will be resized to this value with
2228
2237
  the same image aspect ratio.
2229
2238
  If size is a sequence of length 2, it should be (height, width).
2230
- interpolation (Inter, optional): Image interpolation mode. Default: Inter.LINEAR.
2231
- It can be any of [Inter.LINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
2239
+ interpolation (Inter, optional): Image interpolation mode. Default: ``Inter.LINEAR``.
2240
+ It can be ``Inter.LINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``, ``Inter.AREA``, ``Inter.PILCUBIC``.
2232
2241
 
2233
- - Inter.LINEAR, means interpolation method is bilinear interpolation.
2242
+ - ``Inter.LINEAR`` , means interpolation method is bilinear interpolation.
2234
2243
 
2235
- - Inter.NEAREST, means interpolation method is nearest-neighbor interpolation.
2244
+ - ``Inter.NEAREST`` , means interpolation method is nearest-neighbor interpolation.
2236
2245
 
2237
- - Inter.BICUBIC, means interpolation method is bicubic interpolation.
2246
+ - ``Inter.BICUBIC`` , means interpolation method is bicubic interpolation.
2238
2247
 
2239
- - Inter.AREA, means interpolation method is pixel area interpolation.
2248
+ - ``Inter.AREA`` :, means interpolation method is pixel area interpolation.
2240
2249
 
2241
- - Inter.PILCUBIC, means interpolation method is bicubic interpolation like implemented in pillow, input
2250
+ - ``Inter.PILCUBIC`` , means interpolation method is bicubic interpolation like implemented in pillow, input
2242
2251
  should be in 3 channels format.
2243
2252
 
2244
2253
  Raises:
@@ -2268,7 +2277,8 @@ class Resize(ImageTensorOperation):
2268
2277
  self.interpolation = interpolation
2269
2278
 
2270
2279
  def parse(self):
2271
- return cde.ResizeOperation(self.size, DE_C_INTER_MODE.get(self.interpolation))
2280
+ # deprecated api just support cpu device target
2281
+ return cde.ResizeOperation(self.size, DE_C_INTER_MODE.get(self.interpolation), "CPU")
2272
2282
 
2273
2283
 
2274
2284
  class ResizeWithBBox(ImageTensorOperation):
@@ -2280,14 +2290,14 @@ class ResizeWithBBox(ImageTensorOperation):
2280
2290
  If size is an integer, smaller edge of the image will be resized to this value with
2281
2291
  the same image aspect ratio.
2282
2292
  If size is a sequence of length 2, it should be (height, width).
2283
- interpolation (Inter, optional): Image interpolation mode. Default: Inter.LINEAR.
2284
- It can be any of [Inter.LINEAR, Inter.NEAREST, Inter.BICUBIC].
2293
+ interpolation (Inter, optional): Image interpolation mode. Default: ``Inter.LINEAR``.
2294
+ It can be ``Inter.LINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``.
2285
2295
 
2286
- - Inter.LINEAR, means interpolation method is bilinear interpolation.
2296
+ - ``Inter.LINEAR`` , means interpolation method is bilinear interpolation.
2287
2297
 
2288
- - Inter.NEAREST, means interpolation method is nearest-neighbor interpolation.
2298
+ - ``Inter.NEAREST`` , means interpolation method is nearest-neighbor interpolation.
2289
2299
 
2290
- - Inter.BICUBIC, means interpolation method is bicubic interpolation.
2300
+ - ``Inter.BICUBIC`` , means interpolation method is bicubic interpolation.
2291
2301
 
2292
2302
  Raises:
2293
2303
  TypeError: If `size` is not of type int or Sequence[int].
@@ -2355,23 +2365,23 @@ class Rotate(ImageTensorOperation):
2355
2365
  Args:
2356
2366
  degrees (Union[int, float]): Rotation degrees.
2357
2367
 
2358
- resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
2359
- It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC].
2368
+ resample (Inter, optional): An optional resampling filter. Default: ``Inter.NEAREST``.
2369
+ It can be ``Inter.BILINEAR``, ``Inter.NEAREST``, ``Inter.BICUBIC``.
2360
2370
 
2361
- - Inter.BILINEAR, means resample method is bilinear interpolation.
2362
- - Inter.NEAREST, means resample method is nearest-neighbor interpolation.
2363
- - Inter.BICUBIC, means resample method is bicubic interpolation.
2371
+ - ``Inter.BILINEA`` , means resample method is bilinear interpolation.
2372
+ - ``Inter.NEAREST`` , means resample method is nearest-neighbor interpolation.
2373
+ - ``Inter.BICUBIC`` , means resample method is bicubic interpolation.
2364
2374
 
2365
- expand (bool, optional): Optional expansion flag. Default: False. If set to True, expand the output
2366
- image to make it large enough to hold the entire rotated image.
2367
- If set to False or omitted, make the output image the same size as the input.
2375
+ expand (bool, optional): Optional expansion flag. Default: ``False``. If set to ``True``,
2376
+ expand the output image to make it large enough to hold the entire rotated image.
2377
+ If set to ``False`` or omitted, make the output image the same size as the input.
2368
2378
  Note that the expand flag assumes rotation around the center and no translation.
2369
- center (tuple, optional): Optional center of rotation (a 2-tuple). Default: None.
2370
- Origin is the top left corner. None sets to the center of the image.
2379
+ center (tuple, optional): Optional center of rotation (a 2-tuple). Default: ``None``.
2380
+ Origin is the top left corner. ``None`` sets to the center of the image.
2371
2381
  fill_value (Union[int, tuple[int]], optional): Optional fill color for the area outside the rotated image.
2372
2382
  If it is a 3-tuple, it is used to fill R, G, B channels respectively.
2373
2383
  If it is an integer, it is used for all RGB channels.
2374
- The fill_value values must be in range [0, 255]. Default: 0.
2384
+ The fill_value values must be in range [0, 255]. Default: ``0``.
2375
2385
 
2376
2386
  Raises:
2377
2387
  TypeError: If `degrees` is not of type int or float.
@@ -2424,13 +2434,15 @@ class SlicePatches(ImageTensorOperation):
2424
2434
  number of output tensors is equal to num_height*num_width.
2425
2435
 
2426
2436
  Args:
2427
- num_height (int, optional): The number of patches in vertical direction, which must be positive. Default: 1.
2428
- num_width (int, optional): The number of patches in horizontal direction, which must be positive. Default: 1.
2429
- slice_mode (Inter, optional): A mode represents pad or drop. Default: SliceMode.PAD.
2430
- It can be any of [SliceMode.PAD, SliceMode.DROP].
2437
+ num_height (int, optional): The number of patches in vertical direction, which must be positive.
2438
+ Default: ``1``.
2439
+ num_width (int, optional): The number of patches in horizontal direction, which must be positive.
2440
+ Default: ``1``.
2441
+ slice_mode (Inter, optional): A mode represents pad or drop. Default: ``SliceMode.PAD``.
2442
+ It can be ``SliceMode.PAD``, ``SliceMode.DROP``.
2431
2443
  fill_value (int, optional): The border width in number of pixels in
2432
- right and bottom direction if slice_mode is set to be SliceMode.PAD.
2433
- The fill_value must be in range [0, 255]. Default: 0.
2444
+ right and bottom direction if `slice_mode` is set to be ``SliceMode.PAD``.
2445
+ The fill_value must be in range [0, 255]. Default: ``0``.
2434
2446
 
2435
2447
  Raises:
2436
2448
  TypeError: If `num_height` is not of type int.
@@ -2488,11 +2500,11 @@ class SoftDvppDecodeRandomCropResizeJpeg(ImageTensorOperation):
2488
2500
  If size is an integer, a square crop of size (size, size) is returned.
2489
2501
  If size is a sequence of length 2, an image of size (height, width) will be cropped.
2490
2502
  scale (Union[list, tuple], optional): Range [min, max) of respective size of the
2491
- original size to be cropped, which must be non-negative. Default: (0.08, 1.0).
2503
+ original size to be cropped, which must be non-negative. Default: ``(0.08, 1.0)``.
2492
2504
  ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
2493
- cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
2494
- max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: 10.
2495
- If exceeded, fall back to use center_crop instead. The max_attempts value must be positive.
2505
+ cropped, which must be non-negative. Default: ``(3. / 4., 4. / 3.)``.
2506
+ max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: ``10``.
2507
+ If exceeded, fall back to use center_crop instead. The `max_attempts` value must be positive.
2496
2508
 
2497
2509
  Raises:
2498
2510
  TypeError: If `size` is not of type int or Sequence[int].