mindspore 2.4.10__cp311-cp311-manylinux1_x86_64.whl → 2.5.0__cp311-cp311-manylinux1_x86_64.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 (706) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/Third_Party_Open_Source_Software_Notice +39 -0
  3. mindspore/__init__.py +8 -3
  4. mindspore/_akg/akg/composite/build_module.py +6 -2
  5. mindspore/_akg/akg/utils/kernel_exec.py +2 -2
  6. mindspore/_c_dataengine.cpython-311-x86_64-linux-gnu.so +0 -0
  7. mindspore/_c_expression.cpython-311-x86_64-linux-gnu.so +0 -0
  8. mindspore/_c_mindrecord.cpython-311-x86_64-linux-gnu.so +0 -0
  9. mindspore/_checkparam.py +0 -5
  10. mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
  11. mindspore/_extends/parse/compile_config.py +64 -0
  12. mindspore/_extends/parse/deprecated/__init__.py +0 -0
  13. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +375 -0
  14. mindspore/_extends/parse/parser.py +23 -5
  15. mindspore/_extends/parse/standard_method.py +123 -27
  16. mindspore/_extends/pijit/pijit_func_white_list.py +1 -1
  17. mindspore/amp.py +7 -1
  18. mindspore/boost/boost_cell_wrapper.py +136 -41
  19. mindspore/common/__init__.py +3 -1
  20. mindspore/common/_register_for_tensor.py +0 -1
  21. mindspore/common/_stub_tensor.py +25 -4
  22. mindspore/common/_tensor_cpp_method.py +17 -0
  23. mindspore/common/_tensor_docs.py +6132 -0
  24. mindspore/common/api.py +98 -21
  25. mindspore/common/dtype.py +34 -34
  26. mindspore/common/dump.py +2 -1
  27. mindspore/common/file_system.py +8 -3
  28. mindspore/common/generator.py +2 -0
  29. mindspore/common/hook_handle.py +3 -1
  30. mindspore/common/initializer.py +3 -4
  31. mindspore/common/lazy_inline.py +8 -2
  32. mindspore/common/mindir_util.py +10 -2
  33. mindspore/common/parameter.py +31 -15
  34. mindspore/common/tensor.py +713 -1337
  35. mindspore/communication/__init__.py +1 -1
  36. mindspore/communication/_comm_helper.py +5 -0
  37. mindspore/communication/comm_func.py +215 -173
  38. mindspore/communication/management.py +23 -20
  39. mindspore/context.py +285 -191
  40. mindspore/dataset/__init__.py +23 -19
  41. mindspore/dataset/callback/ds_callback.py +2 -1
  42. mindspore/dataset/core/config.py +84 -3
  43. mindspore/dataset/engine/cache_admin.py +3 -3
  44. mindspore/dataset/engine/cache_client.py +5 -4
  45. mindspore/dataset/engine/datasets.py +192 -149
  46. mindspore/dataset/engine/datasets_audio.py +14 -0
  47. mindspore/dataset/engine/datasets_standard_format.py +11 -11
  48. mindspore/dataset/engine/datasets_text.py +38 -1
  49. mindspore/dataset/engine/datasets_user_defined.py +100 -66
  50. mindspore/dataset/engine/datasets_vision.py +81 -8
  51. mindspore/dataset/engine/iterators.py +281 -63
  52. mindspore/dataset/engine/obs/util.py +8 -0
  53. mindspore/dataset/engine/queue.py +40 -0
  54. mindspore/dataset/engine/samplers.py +26 -2
  55. mindspore/dataset/engine/serializer_deserializer.py +1 -1
  56. mindspore/dataset/engine/validators.py +43 -11
  57. mindspore/dataset/transforms/py_transforms_util.py +17 -0
  58. mindspore/dataset/transforms/transforms.py +29 -12
  59. mindspore/dataset/vision/validators.py +1 -2
  60. mindspore/device_context/__init__.py +21 -0
  61. mindspore/device_context/ascend/__init__.py +25 -0
  62. mindspore/device_context/ascend/device.py +72 -0
  63. mindspore/device_context/ascend/op_debug.py +94 -0
  64. mindspore/device_context/ascend/op_precision.py +193 -0
  65. mindspore/device_context/ascend/op_tuning.py +127 -0
  66. mindspore/device_context/cpu/__init__.py +25 -0
  67. mindspore/device_context/cpu/device.py +62 -0
  68. mindspore/device_context/cpu/op_tuning.py +43 -0
  69. mindspore/device_context/gpu/__init__.py +21 -0
  70. mindspore/device_context/gpu/device.py +70 -0
  71. mindspore/device_context/gpu/op_precision.py +67 -0
  72. mindspore/device_context/gpu/op_tuning.py +175 -0
  73. mindspore/device_manager.py +134 -0
  74. mindspore/experimental/llm_boost/__init__.py +1 -0
  75. mindspore/experimental/llm_boost/ascend_native/__init__.py +22 -0
  76. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +211 -0
  77. mindspore/experimental/llm_boost/ascend_native/llm_boost.py +52 -0
  78. mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
  79. mindspore/experimental/llm_boost/atb/llama_boost.py +6 -1
  80. mindspore/experimental/llm_boost/register.py +1 -0
  81. mindspore/experimental/optim/adadelta.py +26 -22
  82. mindspore/experimental/optim/adam.py +3 -0
  83. mindspore/experimental/optim/lr_scheduler.py +33 -24
  84. mindspore/experimental/optim/radam.py +33 -30
  85. mindspore/hal/device.py +28 -0
  86. mindspore/hal/event.py +17 -0
  87. mindspore/hal/memory.py +94 -3
  88. mindspore/hal/stream.py +91 -6
  89. mindspore/include/api/context.h +0 -1
  90. mindspore/lib/libavcodec.so.59 +0 -0
  91. mindspore/lib/libavdevice.so.59 +0 -0
  92. mindspore/lib/libavfilter.so.8 +0 -0
  93. mindspore/lib/libavformat.so.59 +0 -0
  94. mindspore/lib/libavutil.so.57 +0 -0
  95. mindspore/lib/libdnnl.so.2 +0 -0
  96. mindspore/lib/libicuuc.so.69 +0 -0
  97. mindspore/lib/libmindspore_backend.so +0 -0
  98. mindspore/lib/libmindspore_common.so +0 -0
  99. mindspore/lib/libmindspore_core.so +0 -0
  100. mindspore/lib/libmindspore_glog.so.0 +0 -0
  101. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  102. mindspore/lib/libmindspore_grpc++.so.1 +0 -0
  103. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  104. mindspore/lib/libmindspore_ops.so +0 -0
  105. mindspore/lib/libmpi_adapter.so +0 -0
  106. mindspore/lib/libmpi_collective.so +0 -0
  107. mindspore/lib/libnnacl.so +0 -0
  108. mindspore/lib/libopencv_core.so.4.5 +0 -0
  109. mindspore/lib/libopencv_imgproc.so.4.5 +0 -0
  110. mindspore/lib/libps_cache.so +0 -0
  111. mindspore/lib/libswresample.so.4 +0 -0
  112. mindspore/lib/libswscale.so.6 +0 -0
  113. mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/config/ascend910_93/aic-ascend910_93-ops-info.json +2048 -0
  114. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  115. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  116. mindspore/lib/plugin/ascend/custom_ascendc_910/op_api/lib/libcust_opapi.so +0 -0
  117. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl/dynamic/decoder_kv_cache.py +1 -1
  118. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl/dynamic/prompt_kv_cache.py +1 -1
  119. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64/libcust_opmaster_rt2.0.so +0 -0
  120. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  121. mindspore/lib/plugin/ascend/custom_ascendc_910/op_proto/lib/linux/x86_64/libcust_opsproto_rt2.0.so +0 -0
  122. mindspore/lib/plugin/ascend/custom_ascendc_910/version.info +1 -1
  123. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_api/lib/libcust_opapi.so +0 -0
  124. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/config/ascend910_93/aic-ascend910_93-ops-info.json +224 -0
  125. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/all_finite.py +1 -1
  126. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/decoder_kv_cache.py +1 -1
  127. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/prompt_kv_cache.py +1 -1
  128. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.json +78 -0
  129. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.o +0 -0
  130. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.json +78 -0
  131. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.o +0 -0
  132. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.json +78 -0
  133. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.o +0 -0
  134. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.json +156 -0
  135. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.o +0 -0
  136. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.json +156 -0
  137. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.o +0 -0
  138. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.json +156 -0
  139. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.o +0 -0
  140. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.json +156 -0
  141. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.o +0 -0
  142. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.json +156 -0
  143. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.o +0 -0
  144. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.json +156 -0
  145. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.o +0 -0
  146. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.json +156 -0
  147. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.o +0 -0
  148. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.json +156 -0
  149. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.o +0 -0
  150. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.json +165 -0
  151. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.o +0 -0
  152. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.json +165 -0
  153. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.o +0 -0
  154. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.json +165 -0
  155. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.o +0 -0
  156. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.json +165 -0
  157. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.o +0 -0
  158. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.json +165 -0
  159. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.o +0 -0
  160. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.json +165 -0
  161. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.o +0 -0
  162. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.json +165 -0
  163. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.o +0 -0
  164. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.json +165 -0
  165. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910_93/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.o +0 -0
  166. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910_93/all_finite.json +139 -0
  167. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910_93/binary_info_config.json +361 -0
  168. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910_93/decoder_kv_cache.json +892 -0
  169. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910_93/prompt_kv_cache.json +892 -0
  170. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64/libcust_opmaster_rt2.0.so +0 -0
  171. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  172. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_proto/lib/linux/x86_64/libcust_opsproto_rt2.0.so +0 -0
  173. mindspore/lib/plugin/ascend/custom_ascendc_910b/version.info +1 -1
  174. mindspore/lib/plugin/ascend/custom_compiler/setup.py +1 -1
  175. mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
  176. mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
  177. mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
  178. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  179. mindspore/lib/plugin/ascend/libmindspore_internal_kernels.so +0 -0
  180. mindspore/lib/plugin/ascend/libms_ascend_native_boost.so +0 -0
  181. mindspore/lib/plugin/ascend/libms_atb_boost.so +0 -0
  182. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +960 -958
  183. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{acme/include/base_type.h → base_type.h} +25 -20
  184. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{cast/cast_tiling.h → internal.h} +6 -4
  185. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_op.h +114 -0
  186. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/llm/boost_kernel.h +70 -0
  187. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/llm/llama_impl.h +85 -0
  188. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/llm/model_interface.h +52 -0
  189. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/llm/tensor.h +81 -0
  190. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_creator.h +123 -0
  191. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +155 -110
  192. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{acme/include/tiling_info.h → tiling_info.h} +12 -9
  193. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tiling_utils.h +178 -0
  194. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layer_norm_op.so +0 -0
  195. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_op.so +0 -0
  196. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_quant_op.so +0 -0
  197. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_310p_op.so +0 -0
  198. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_op.so +0 -0
  199. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_op.so +0 -0
  200. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcompare_op.so +0 -0
  201. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_op.so +0 -0
  202. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libllama_op.so +0 -0
  203. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_op.so +0 -0
  204. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
  205. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_optiling.so +0 -0
  206. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmulti_weight_matmul_kernel_op.so +0 -0
  207. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_nz_op.so +0 -0
  208. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_op.so +0 -0
  209. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_op.so +0 -0
  210. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_f16_nz/internal_pp_matmul_f16_nz.o +0 -0
  211. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_f16_nz/internal_pp_matmul_f16_nz_0.o +0 -0
  212. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_i8_nz_compress/internal_pp_matmul_i8_nz_compress.o +0 -0
  213. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_i8_nz_compress/internal_pp_matmul_i8_nz_compress_0.o +0 -0
  214. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_int8_nz/internal_pp_matmul_int8_nz.o +0 -0
  215. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/object_kernels/internal_pp_matmul_int8_nz/internal_pp_matmul_int8_nz_0.o +0 -0
  216. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libadd_rms_norm_quant_ascend310p.so +0 -0
  217. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libapply_rotary_pos_emb_310p_impl.so → op_kernels/ascend310p/so_kernels/libapply_rotary_pos_emb_310p_ascend310p.so} +0 -0
  218. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libcast_ascend310p.so +0 -0
  219. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libcompare_ascend310p.so +0 -0
  220. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libgelu_ascend310p.so +0 -0
  221. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libmatmul_ascend310p.so +0 -0
  222. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend310p/so_kernels/libreshape_and_cache_nz_ascend310p.so +0 -0
  223. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/hphol_kernels/add_rms_norm_dynamic_quant/AddRmsNormDynamicQuant_4b60f88cdc28b25a36bad2d8b0a88092.json +163 -0
  224. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/hphol_kernels/add_rms_norm_dynamic_quant/AddRmsNormDynamicQuant_4b60f88cdc28b25a36bad2d8b0a88092.o +0 -0
  225. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/hphol_kernels/add_rms_norm_dynamic_quant/AddRmsNormDynamicQuant_cde61da2bd6fededcb1ba310a6ad16ee.json +163 -0
  226. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/hphol_kernels/add_rms_norm_dynamic_quant/AddRmsNormDynamicQuant_cde61da2bd6fededcb1ba310a6ad16ee.o +0 -0
  227. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  228. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
  229. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_bf16_bsh_full_mix.o +0 -0
  230. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
  231. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  232. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  233. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  234. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/flash_attention_score/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  235. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_matmul_postfusion_mix/internal_matmul_postfusion_mix.o +0 -0
  236. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_matmul_postfusion_mix/internal_matmul_postfusion_mix_mix_aic_0.o +0 -0
  237. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_matmul_postfusion_mix/internal_matmul_postfusion_mix_mix_aiv_0.o +0 -0
  238. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_multi_weight_matmul_postfusion_mix/internal_multi_weight_matmul_postfusion_mix.o +0 -0
  239. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_multi_weight_matmul_postfusion_mix/internal_multi_weight_matmul_postfusion_mix_mix_aic_0.o +0 -0
  240. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/internal_multi_weight_matmul_postfusion_mix/internal_multi_weight_matmul_postfusion_mix_mix_aiv_0.o +0 -0
  241. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_bf16.o +0 -0
  242. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_fp16.o +0 -0
  243. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_fp32.o +0 -0
  244. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_bf16.o +0 -0
  245. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_fp16.o +0 -0
  246. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_fp32.o +0 -0
  247. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/paged_attention_v2/paged_attention_v2.o +0 -0
  248. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/paged_attention_v2/paged_attention_v2_mix_aic_0.o +0 -0
  249. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/object_kernels/paged_attention_v2/paged_attention_v2_mix_aiv_0.o +0 -0
  250. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/so_kernels/libadd_layer_norm_ascend910b.so +0 -0
  251. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libadd_rms_norm_impl.so → op_kernels/ascend910b/so_kernels/libadd_rms_norm_ascend910b.so} +0 -0
  252. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/so_kernels/libadd_rms_norm_quant_ascend910b.so +0 -0
  253. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libapply_rotary_pos_emb_impl.so → op_kernels/ascend910b/so_kernels/libapply_rotary_pos_emb_ascend910b.so} +0 -0
  254. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libcast_impl.so → op_kernels/ascend910b/so_kernels/libcast_ascend910b.so} +0 -0
  255. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libnot_equal_impl.so → op_kernels/ascend910b/so_kernels/libcompare_ascend910b.so} +0 -0
  256. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libgelu_impl.so → op_kernels/ascend910b/so_kernels/libgelu_ascend910b.so} +0 -0
  257. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/so_kernels/libllama_ascend910b.so +0 -0
  258. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libmatmul_impl.so → op_kernels/ascend910b/so_kernels/libmatmul_ascend910b.so} +0 -0
  259. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libmulti_weight_matmul_kernel_impl.so → op_kernels/ascend910b/so_kernels/libmulti_weight_matmul_kernel_ascend910b.so} +0 -0
  260. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/libreshape_and_cache_impl.so → op_kernels/ascend910b/so_kernels/libreshape_and_cache_ascend910b.so} +0 -0
  261. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/{lib/librms_norm_impl.so → op_kernels/ascend910b/so_kernels/librms_norm_ascend910b.so} +0 -0
  262. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
  263. mindspore/lib/plugin/gpu/libcuda_ops.so.10 +0 -0
  264. mindspore/lib/plugin/gpu/libcuda_ops.so.11 +0 -0
  265. mindspore/lib/plugin/gpu10.1/libnccl.so.2 +0 -0
  266. mindspore/lib/plugin/gpu10.1/libnvidia_collective.so +0 -0
  267. mindspore/lib/plugin/gpu11.1/libnccl.so.2 +0 -0
  268. mindspore/lib/plugin/gpu11.1/libnvidia_collective.so +0 -0
  269. mindspore/lib/plugin/gpu11.6/libnccl.so.2 +0 -0
  270. mindspore/lib/plugin/gpu11.6/libnvidia_collective.so +0 -0
  271. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  272. mindspore/lib/plugin/libmindspore_gpu.so.10.1 +0 -0
  273. mindspore/lib/plugin/libmindspore_gpu.so.11.1 +0 -0
  274. mindspore/lib/plugin/libmindspore_gpu.so.11.6 +0 -0
  275. mindspore/log.py +12 -0
  276. mindspore/mindrecord/__init__.py +1 -1
  277. mindspore/mindrecord/config.py +17 -316
  278. mindspore/mindrecord/filereader.py +1 -9
  279. mindspore/mindrecord/filewriter.py +5 -15
  280. mindspore/mindrecord/mindpage.py +1 -9
  281. mindspore/mint/__init__.py +824 -218
  282. mindspore/mint/distributed/__init__.py +66 -4
  283. mindspore/mint/distributed/distributed.py +2594 -44
  284. mindspore/mint/linalg/__init__.py +6 -0
  285. mindspore/mint/nn/__init__.py +473 -14
  286. mindspore/mint/nn/functional.py +486 -11
  287. mindspore/mint/nn/layer/__init__.py +17 -4
  288. mindspore/mint/nn/layer/_functions.py +330 -0
  289. mindspore/mint/nn/layer/activation.py +169 -1
  290. mindspore/mint/nn/layer/basic.py +123 -0
  291. mindspore/mint/nn/layer/conv.py +727 -0
  292. mindspore/mint/nn/layer/normalization.py +215 -19
  293. mindspore/mint/nn/layer/padding.py +797 -0
  294. mindspore/mint/nn/layer/pooling.py +170 -0
  295. mindspore/mint/optim/__init__.py +2 -1
  296. mindspore/mint/optim/adam.py +223 -0
  297. mindspore/mint/optim/adamw.py +26 -19
  298. mindspore/mint/special/__init__.py +2 -1
  299. mindspore/multiprocessing/__init__.py +5 -0
  300. mindspore/nn/cell.py +126 -19
  301. mindspore/nn/dynamic_lr.py +2 -1
  302. mindspore/nn/layer/activation.py +6 -6
  303. mindspore/nn/layer/basic.py +35 -25
  304. mindspore/nn/layer/channel_shuffle.py +3 -3
  305. mindspore/nn/layer/embedding.py +3 -3
  306. mindspore/nn/layer/normalization.py +8 -7
  307. mindspore/nn/layer/padding.py +4 -3
  308. mindspore/nn/layer/pooling.py +47 -13
  309. mindspore/nn/layer/rnn_cells.py +1 -1
  310. mindspore/nn/layer/rnns.py +2 -1
  311. mindspore/nn/layer/timedistributed.py +5 -5
  312. mindspore/nn/layer/transformer.py +48 -26
  313. mindspore/nn/learning_rate_schedule.py +5 -3
  314. mindspore/nn/loss/loss.py +31 -36
  315. mindspore/nn/optim/ada_grad.py +1 -0
  316. mindspore/nn/optim/adadelta.py +2 -2
  317. mindspore/nn/optim/adam.py +1 -1
  318. mindspore/nn/optim/lars.py +1 -4
  319. mindspore/nn/optim/optimizer.py +1 -1
  320. mindspore/nn/optim/rprop.py +2 -2
  321. mindspore/nn/optim/thor.py +2 -1
  322. mindspore/nn/utils/init.py +13 -11
  323. mindspore/nn/wrap/cell_wrapper.py +4 -6
  324. mindspore/nn/wrap/loss_scale.py +3 -4
  325. mindspore/numpy/array_creations.py +60 -62
  326. mindspore/numpy/array_ops.py +148 -143
  327. mindspore/numpy/logic_ops.py +41 -42
  328. mindspore/numpy/math_ops.py +361 -359
  329. mindspore/numpy/utils.py +16 -16
  330. mindspore/numpy/utils_const.py +4 -4
  331. mindspore/ops/__init__.py +2 -1
  332. mindspore/ops/_grad_experimental/grad_comm_ops.py +94 -13
  333. mindspore/ops/_grad_experimental/grad_debug_ops.py +6 -1
  334. mindspore/ops/_grad_experimental/grad_inner_ops.py +9 -0
  335. mindspore/ops/_grad_experimental/grad_math_ops.py +2 -1
  336. mindspore/ops/_op_impl/cpu/__init__.py +1 -0
  337. mindspore/ops/_op_impl/cpu/raise_op.py +28 -0
  338. mindspore/ops/_vmap/vmap_array_ops.py +20 -19
  339. mindspore/ops/_vmap/vmap_base.py +0 -2
  340. mindspore/ops/_vmap/vmap_grad_nn_ops.py +19 -13
  341. mindspore/ops/_vmap/vmap_math_ops.py +11 -9
  342. mindspore/ops/_vmap/vmap_nn_ops.py +20 -34
  343. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +149 -12
  344. mindspore/ops/auto_generate/gen_arg_handler.py +0 -61
  345. mindspore/ops/auto_generate/gen_extend_func.py +554 -60
  346. mindspore/ops/auto_generate/gen_ops_def.py +1621 -115
  347. mindspore/ops/auto_generate/gen_ops_prim.py +8024 -3409
  348. mindspore/ops/auto_generate/pyboost_inner_prim.py +183 -79
  349. mindspore/ops/composite/base.py +1 -1
  350. mindspore/ops/composite/multitype_ops/_compile_utils.py +229 -30
  351. mindspore/ops/composite/multitype_ops/pow_impl.py +0 -29
  352. mindspore/ops/function/__init__.py +12 -0
  353. mindspore/ops/function/array_func.py +561 -159
  354. mindspore/ops/function/clip_func.py +64 -0
  355. mindspore/ops/function/debug_func.py +28 -20
  356. mindspore/ops/function/image_func.py +1 -1
  357. mindspore/ops/function/linalg_func.py +5 -4
  358. mindspore/ops/function/math_func.py +1659 -290
  359. mindspore/ops/function/nn_func.py +988 -317
  360. mindspore/ops/function/parameter_func.py +3 -56
  361. mindspore/ops/function/random_func.py +243 -33
  362. mindspore/ops/function/sparse_unary_func.py +1 -1
  363. mindspore/ops/functional.py +18 -5
  364. mindspore/ops/functional_overload.py +897 -0
  365. mindspore/ops/operations/__init__.py +3 -2
  366. mindspore/ops/operations/_embedding_cache_ops.py +4 -4
  367. mindspore/ops/operations/_grad_ops.py +2 -34
  368. mindspore/ops/operations/_infer_ops.py +2 -1
  369. mindspore/ops/operations/_inner_ops.py +38 -8
  370. mindspore/ops/operations/array_ops.py +45 -303
  371. mindspore/ops/operations/comm_ops.py +19 -16
  372. mindspore/ops/operations/custom_ops.py +11 -55
  373. mindspore/ops/operations/debug_ops.py +42 -47
  374. mindspore/ops/operations/inner_ops.py +6 -4
  375. mindspore/ops/operations/linalg_ops.py +3 -2
  376. mindspore/ops/operations/manually_defined/ops_def.py +185 -104
  377. mindspore/ops/operations/math_ops.py +11 -216
  378. mindspore/ops/operations/nn_ops.py +146 -308
  379. mindspore/ops/primitive.py +23 -21
  380. mindspore/ops/tensor_method.py +1669 -0
  381. mindspore/ops_generate/aclnn_kernel_register_auto_cc_generator.py +110 -0
  382. mindspore/ops_generate/add_tensor_docs_generator.py +54 -0
  383. mindspore/ops_generate/arg_handler.py +0 -61
  384. mindspore/ops_generate/auto_grad_impl_cc_generator.py +135 -0
  385. mindspore/ops_generate/auto_grad_reg_cc_generator.py +93 -0
  386. mindspore/ops_generate/base_generator.py +11 -0
  387. mindspore/ops_generate/cpp_create_prim_instance_helper_generator.py +108 -0
  388. mindspore/ops_generate/functional_map_cpp_generator.py +491 -0
  389. mindspore/ops_generate/functional_overload_py_generator.py +110 -0
  390. mindspore/ops_generate/functions_cc_generator.py +233 -0
  391. mindspore/ops_generate/gen_aclnn_implement.py +110 -114
  392. mindspore/ops_generate/gen_constants.py +157 -3
  393. mindspore/ops_generate/gen_ops.py +245 -990
  394. mindspore/ops_generate/gen_pyboost_func.py +97 -998
  395. mindspore/ops_generate/gen_utils.py +119 -33
  396. mindspore/ops_generate/lite_ops_cpp_generator.py +155 -0
  397. mindspore/ops_generate/op_api_proto.py +206 -0
  398. mindspore/ops_generate/op_def_py_generator.py +131 -0
  399. mindspore/ops_generate/op_prim_py_generator.py +480 -0
  400. mindspore/ops_generate/op_proto.py +373 -108
  401. mindspore/ops_generate/op_template_parser.py +436 -0
  402. mindspore/ops_generate/ops_def_cc_generator.py +288 -0
  403. mindspore/ops_generate/ops_def_h_generator.py +74 -0
  404. mindspore/ops_generate/ops_name_h_generator.py +68 -0
  405. mindspore/ops_generate/ops_primitive_h_generator.py +81 -0
  406. mindspore/ops_generate/pyboost_functions_cpp_generator.py +370 -0
  407. mindspore/ops_generate/pyboost_functions_h_generator.py +68 -0
  408. mindspore/ops_generate/pyboost_functions_py_generator.py +148 -0
  409. mindspore/ops_generate/pyboost_grad_function_cpp_generator.py +154 -0
  410. mindspore/ops_generate/pyboost_inner_prim_generator.py +131 -0
  411. mindspore/ops_generate/pyboost_native_grad_functions_generator.py +268 -0
  412. mindspore/ops_generate/pyboost_op_cpp_code_generator.py +851 -0
  413. mindspore/ops_generate/pyboost_overload_functions_cpp_generator.py +344 -0
  414. mindspore/ops_generate/pyboost_utils.py +92 -33
  415. mindspore/ops_generate/template.py +294 -44
  416. mindspore/ops_generate/tensor_func_reg_cpp_generator.py +422 -0
  417. mindspore/parallel/__init__.py +3 -3
  418. mindspore/parallel/_auto_parallel_context.py +24 -33
  419. mindspore/parallel/_parallel_serialization.py +13 -2
  420. mindspore/parallel/_utils.py +4 -1
  421. mindspore/parallel/algo_parameter_config.py +1 -1
  422. mindspore/parallel/checkpoint_transform.py +44 -0
  423. mindspore/parallel/cluster/process_entity/_api.py +131 -37
  424. mindspore/parallel/cluster/process_entity/_utils.py +41 -6
  425. mindspore/parallel/cluster/run.py +20 -3
  426. mindspore/parallel/parameter_broadcast.py +1 -1
  427. mindspore/parallel/shard.py +3 -0
  428. mindspore/parallel/transform_safetensors.py +119 -253
  429. mindspore/profiler/__init__.py +17 -4
  430. mindspore/profiler/analysis/__init__.py +0 -0
  431. mindspore/profiler/analysis/parser/__init__.py +0 -0
  432. mindspore/profiler/analysis/parser/ascend_cann_parser.py +166 -0
  433. mindspore/profiler/analysis/parser/base_parser.py +158 -0
  434. mindspore/profiler/analysis/parser/framework_cann_relation_parser.py +45 -0
  435. mindspore/profiler/analysis/parser/ms_framework_parser.py +142 -0
  436. mindspore/profiler/analysis/parser/ms_minddata_parser.py +145 -0
  437. mindspore/profiler/analysis/parser/timeline_assembly_factory/__init__.py +0 -0
  438. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +261 -0
  439. mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +40 -0
  440. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +84 -0
  441. mindspore/profiler/analysis/parser/timeline_creator/__init__.py +0 -0
  442. mindspore/profiler/analysis/parser/timeline_creator/base_timeline_creator.py +44 -0
  443. mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +90 -0
  444. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +76 -0
  445. mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +103 -0
  446. mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +134 -0
  447. mindspore/profiler/analysis/parser/timeline_event/__init__.py +0 -0
  448. mindspore/profiler/analysis/parser/timeline_event/base_event.py +233 -0
  449. mindspore/profiler/analysis/parser/timeline_event/cpu_op_event.py +47 -0
  450. mindspore/profiler/analysis/parser/timeline_event/flow_event.py +36 -0
  451. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +260 -0
  452. mindspore/profiler/analysis/parser/timeline_event/msprof_event.py +73 -0
  453. mindspore/profiler/analysis/parser/timeline_event/scope_layer_event.py +53 -0
  454. mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +146 -0
  455. mindspore/profiler/analysis/task_manager.py +131 -0
  456. mindspore/profiler/analysis/time_converter.py +84 -0
  457. mindspore/profiler/analysis/viewer/__init__.py +0 -0
  458. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +333 -0
  459. mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +87 -0
  460. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +252 -0
  461. mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +313 -0
  462. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +322 -0
  463. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +265 -0
  464. mindspore/profiler/analysis/viewer/ascend_timeline_viewer.py +58 -0
  465. mindspore/profiler/analysis/viewer/base_viewer.py +26 -0
  466. mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +97 -0
  467. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +581 -0
  468. mindspore/profiler/analysis/work_flow.py +73 -0
  469. mindspore/profiler/common/ascend_msprof_exporter.py +138 -0
  470. mindspore/profiler/common/command_executor.py +90 -0
  471. mindspore/profiler/common/constant.py +174 -3
  472. mindspore/profiler/common/file_manager.py +208 -0
  473. mindspore/profiler/common/log.py +130 -0
  474. mindspore/profiler/common/msprof_cmd_tool.py +202 -0
  475. mindspore/profiler/common/path_manager.py +371 -0
  476. mindspore/profiler/common/process_bar.py +168 -0
  477. mindspore/profiler/common/process_pool.py +9 -3
  478. mindspore/profiler/common/profiler_context.py +476 -0
  479. mindspore/profiler/common/profiler_info.py +304 -0
  480. mindspore/profiler/common/profiler_output_path.py +284 -0
  481. mindspore/profiler/common/profiler_parameters.py +210 -0
  482. mindspore/profiler/common/profiler_path_manager.py +120 -0
  483. mindspore/profiler/common/record_function.py +76 -0
  484. mindspore/profiler/common/tlv_decoder.py +76 -0
  485. mindspore/profiler/common/util.py +75 -2
  486. mindspore/profiler/dynamic_profiler.py +270 -37
  487. mindspore/profiler/envprofiler.py +138 -0
  488. mindspore/profiler/mstx.py +199 -0
  489. mindspore/profiler/platform/__init__.py +21 -0
  490. mindspore/profiler/platform/base_profiler.py +40 -0
  491. mindspore/profiler/platform/cpu_profiler.py +124 -0
  492. mindspore/profiler/platform/gpu_profiler.py +74 -0
  493. mindspore/profiler/platform/npu_profiler.py +309 -0
  494. mindspore/profiler/profiler.py +580 -93
  495. mindspore/profiler/profiler_action_controller.py +187 -0
  496. mindspore/profiler/profiler_interface.py +114 -0
  497. mindspore/profiler/schedule.py +208 -0
  498. mindspore/rewrite/api/symbol_tree.py +1 -2
  499. mindspore/run_check/_check_version.py +2 -6
  500. mindspore/runtime/__init__.py +37 -0
  501. mindspore/runtime/device.py +27 -0
  502. mindspore/runtime/event.py +209 -0
  503. mindspore/runtime/executor.py +148 -0
  504. mindspore/runtime/memory.py +392 -0
  505. mindspore/runtime/stream.py +460 -0
  506. mindspore/runtime/thread_bind_core.py +401 -0
  507. mindspore/train/__init__.py +2 -2
  508. mindspore/train/_utils.py +53 -18
  509. mindspore/train/amp.py +8 -4
  510. mindspore/train/callback/_checkpoint.py +32 -18
  511. mindspore/train/callback/_early_stop.py +1 -1
  512. mindspore/train/callback/_flops_collector.py +105 -69
  513. mindspore/train/callback/_history.py +1 -1
  514. mindspore/train/callback/_summary_collector.py +44 -6
  515. mindspore/train/callback/_tft_register.py +31 -10
  516. mindspore/train/dataset_helper.py +11 -11
  517. mindspore/train/metrics/precision.py +4 -5
  518. mindspore/train/mind_ir_pb2.py +167 -46
  519. mindspore/train/model.py +13 -15
  520. mindspore/train/serialization.py +462 -76
  521. mindspore/train/summary/summary_record.py +1 -2
  522. mindspore/train/train_thor/model_thor.py +1 -1
  523. mindspore/utils/__init__.py +4 -2
  524. mindspore/utils/bin/dataset-cache +0 -0
  525. mindspore/utils/bin/dataset-cache-server +0 -0
  526. mindspore/utils/dryrun.py +138 -0
  527. mindspore/utils/runtime_execution_order_check.py +550 -0
  528. mindspore/version.py +1 -1
  529. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/METADATA +2 -3
  530. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/RECORD +533 -467
  531. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/entry_points.txt +1 -1
  532. mindspore/_data_dump.cpython-311-x86_64-linux-gnu.so +0 -0
  533. mindspore/bin/cache_admin +0 -0
  534. mindspore/bin/cache_server +0 -0
  535. mindspore/common/_tensor_overload.py +0 -139
  536. mindspore/lib/libmindspore_np_dtype.so +0 -0
  537. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme.h +0 -24
  538. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme_op.h +0 -82
  539. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_creator.h +0 -113
  540. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_param.h +0 -193
  541. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/dtype_registry.h +0 -90
  542. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/kernel_register.h +0 -46
  543. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/platform_configs.h +0 -89
  544. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/rt_funcs.h +0 -135
  545. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_layer_norm_op.h +0 -60
  546. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_rms_norm_op.h +0 -50
  547. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_rms_norm_quant_op.h +0 -50
  548. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/apply_rotary_pos_emb_nz_op.h +0 -42
  549. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/apply_rotary_pos_emb_op.h +0 -55
  550. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_elewise_op.h +0 -34
  551. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_only_ops.h +0 -94
  552. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_op_base.h +0 -97
  553. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/cast_op.h +0 -52
  554. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/flash_attention_score_op.h +0 -97
  555. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/gelu_op.h +0 -44
  556. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/matmul_add_rmsnorm_op.h +0 -73
  557. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/matmul_op.h +0 -108
  558. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/multi_impls_op.h +0 -64
  559. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/multi_weight_matmul_op.h +0 -91
  560. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/paged_attention_op.h +0 -99
  561. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/reshape_and_cache_nz_op.h +0 -44
  562. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/reshape_and_cache_op.h +0 -44
  563. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/rms_norm_op.h +0 -64
  564. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/asd_utils.h +0 -179
  565. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/comm_utils.h +0 -69
  566. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/profiling_util.h +0 -366
  567. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/add_impl.h +0 -56
  568. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/kernel/add.h +0 -21
  569. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/tiling/add_tiling.h +0 -43
  570. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +0 -46
  571. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb.h +0 -23
  572. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_base.h +0 -456
  573. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_bf16.h +0 -217
  574. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp.h +0 -391
  575. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp16.h +0 -126
  576. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp32.h +0 -230
  577. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_tiling.h +0 -43
  578. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_value.h +0 -27
  579. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/apply_rotary_pos_emb_nz_impl.h +0 -34
  580. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz.h +0 -23
  581. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz_base.h +0 -460
  582. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz_fp16.h +0 -116
  583. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz_fp32.h +0 -230
  584. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz_tiling.h +0 -43
  585. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb_nz/kernel/apply_rotary_pos_emb_nz_value.h +0 -27
  586. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -74
  587. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/backend_param.h +0 -74
  588. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/cast/cast_impl.h +0 -48
  589. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/cast/kernel/cast_kernel.h +0 -21
  590. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/compare_impl.h +0 -55
  591. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/compare_tiling.h +0 -27
  592. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/kernel/compare_kernel.h +0 -23
  593. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/and_impl.h +0 -29
  594. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/div_impl.h +0 -29
  595. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_impl.h +0 -48
  596. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_tiling.h +0 -25
  597. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/and_kernel.h +0 -46
  598. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/div_kernel.h +0 -46
  599. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_base.h +0 -260
  600. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_kernel.h +0 -35
  601. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/max_kernel.h +0 -66
  602. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/min_kernel.h +0 -66
  603. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/mul_kernel.h +0 -66
  604. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/or_kernel.h +0 -46
  605. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/max_impl.h +0 -29
  606. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/min_impl.h +0 -29
  607. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/mul_impl.h +0 -29
  608. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/or_impl.h +0 -29
  609. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/abs_impl.h +0 -29
  610. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_impl.h +0 -47
  611. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_tiling.h +0 -24
  612. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/exp_impl.h +0 -29
  613. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/abs_kernel.h +0 -45
  614. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_base.h +0 -148
  615. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_kernel.h +0 -31
  616. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/exp_kernel.h +0 -45
  617. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/ln_kernel.h +0 -45
  618. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/not_kernel.h +0 -45
  619. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/reciprocal_kernel.h +0 -45
  620. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/relu_kernel.h +0 -55
  621. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/rsqrt_kernel.h +0 -45
  622. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/sqrt_kernel.h +0 -45
  623. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/ln_impl.h +0 -29
  624. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/not_impl.h +0 -29
  625. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/reciprocal_impl.h +0 -29
  626. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/relu_impl.h +0 -29
  627. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/rsqrt_impl.h +0 -29
  628. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/sqrt_impl.h +0 -29
  629. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_impl.h +0 -68
  630. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_kernel.h +0 -99
  631. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_rtbackend.h +0 -21
  632. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/lccl/lccl_wrapper.h +0 -58
  633. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/ms_int_types.h +0 -91
  634. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/ms_int_utils.h +0 -108
  635. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_impl.h +0 -64
  636. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/add_param.h +0 -68
  637. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/attention_param.h +0 -40
  638. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/cast_param.h +0 -30
  639. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/compare_param.h +0 -31
  640. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/elewise_param.h +0 -41
  641. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/grouped_matmul_param.h +0 -40
  642. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +0 -38
  643. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_qkv_param.h +0 -42
  644. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +0 -33
  645. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/profiling_util.h +0 -377
  646. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/reshape_and_cache_nz/kernel/reshape_and_cache_nz.h +0 -24
  647. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/reshape_and_cache_nz/reshape_and_cache_nz_impl.h +0 -42
  648. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/reshape_and_cache_nz/reshape_and_cache_nz_tiling.h +0 -27
  649. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +0 -46
  650. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/kernel/sub_kernel.h +0 -20
  651. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +0 -48
  652. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_tiling.h +0 -25
  653. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +0 -399
  654. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/utils.h +0 -41
  655. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/backend.h +0 -45
  656. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/elewise_tiling.h +0 -29
  657. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/elewise_utils.h +0 -30
  658. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log.h +0 -69
  659. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_core.h +0 -43
  660. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_entity.h +0 -38
  661. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_sink.h +0 -69
  662. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_stream.h +0 -41
  663. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +0 -71
  664. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_utils.h +0 -165
  665. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/math.h +0 -20
  666. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_creator.h +0 -39
  667. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_registry.h +0 -121
  668. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/utils.h +0 -106
  669. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
  670. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
  671. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layer_norm_impl.so +0 -0
  672. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_quant_acme_impl.so +0 -0
  673. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_310p_old_impl.so +0 -0
  674. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_old_impl.so +0 -0
  675. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_nz_impl.so +0 -0
  676. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_nz_old_impl.so +0 -0
  677. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMatMulPostFusionMixTactic/acme_matmul_postfusion_mix.json +0 -19
  678. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMatMulPostFusionMixTactic/acme_matmul_postfusion_mix.o +0 -0
  679. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMatMulPostFusionMixTactic/acme_matmul_postfusion_mix_mix_aic_0.o +0 -0
  680. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMatMulPostFusionMixTactic/acme_matmul_postfusion_mix_mix_aiv_0.o +0 -0
  681. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMultiWeightMatMulPostFusionMixTactic/acme_multi_weight_matmul_postfusion_mix.json +0 -19
  682. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMultiWeightMatMulPostFusionMixTactic/acme_multi_weight_matmul_postfusion_mix.o +0 -0
  683. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMultiWeightMatMulPostFusionMixTactic/acme_multi_weight_matmul_postfusion_mix_mix_aic_0.o +0 -0
  684. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/AcmeMultiWeightMatMulPostFusionMixTactic/acme_multi_weight_matmul_postfusion_mix_mix_aiv_0.o +0 -0
  685. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  686. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
  687. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_bf16_bsh_full_mix.o +0 -0
  688. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
  689. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  690. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  691. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  692. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  693. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_bf16.o +0 -0
  694. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_fp16.o +0 -0
  695. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_bf16_fp32.o +0 -0
  696. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_bf16.o +0 -0
  697. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_fp16.o +0 -0
  698. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/matmul_add_rmsnorm/matmul_add_rmsnorm_fp16_fp32.o +0 -0
  699. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_bf16_bnsd_mix.o +0 -0
  700. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_bf16_bsh_mix.o +0 -0
  701. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_fp16_bnsd_mix.o +0 -0
  702. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_fp16_bsh_mix.o +0 -0
  703. mindspore/profiler/envprofiling.py +0 -254
  704. mindspore/profiler/profiling.py +0 -1926
  705. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/WHEEL +0 -0
  706. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/top_level.txt +0 -0
@@ -33,12 +33,12 @@ from mindspore.ops.operations._sequence_ops import TupleToTensor
33
33
  from mindspore.ops.composite.multitype_ops import _constexpr_utils as const_utils
34
34
  from mindspore.ops.operations._sequence_ops import TensorToList
35
35
  from mindspore.ops.auto_generate import OnesLikeExt, ZerosLikeExt, FillScalar, FillTensor, Arange, Chunk, UniqueDim, \
36
- Unique2, SortExt, NonZero, NonZeroExt, Scatter, ScatterValue
37
- from mindspore.ops.auto_generate.gen_ops_prim import SplitTensor
36
+ Unique2, SortExt, NonZero, NonZeroExt, Scatter, ScatterValue, NewOnes, NewZeros
37
+ from mindspore.ops.auto_generate.gen_ops_prim import SplitTensor, Meshgrid
38
38
  from mindspore.ops.auto_generate.gen_ops_prim import SplitWithSize, RepeatInterleaveInt, RepeatInterleaveTensor
39
- from mindspore.ops.auto_generate.pyboost_inner_prim import _PyboostSearchSortedPrim
39
+ from mindspore.ops.auto_generate.pyboost_inner_prim import _PyboostSearchSortedPrim, meshgrid_impl, \
40
+ unique_consecutive_impl
40
41
  from mindspore.ops.operations.array_ops import (
41
- UniqueConsecutive,
42
42
  MatrixDiagV3,
43
43
  MatrixDiagPartV3,
44
44
  MatrixSetDiagV3,
@@ -60,16 +60,21 @@ from mindspore.ops.operations.array_ops import (
60
60
  from mindspore.common import Tensor
61
61
  from mindspore.ops._primitive_cache import _get_cache_prim
62
62
  from mindspore import _checkparam as validator
63
- from mindspore._c_expression import Tensor as Tensor_
64
63
  from mindspore.ops._utils.utils import ms_arrange
65
64
 
66
65
  from mindspore.ops.auto_generate import cat, range, scatter_nd, deepcopy, masked_fill, diagonal, expand_dims, \
67
66
  flip, transpose, triu, unsorted_segment_sum, diag, gather, gather_d, gather_nd, reshape, masked_select, \
68
- broadcast_to, strided_slice, ones, zeros, max_, min_, select, zero_
67
+ broadcast_to, strided_slice, ones, zeros, max_, min_, select, zero_, view_as, \
68
+ expand_as, unstack_ext_op, full_like_op, \
69
+ index_fill_scalar, index_fill_tensor
69
70
  from mindspore.ops.auto_generate import tensor_scatter_elements as tensor_scatter_elements_ext
70
- from mindspore.ops.auto_generate.gen_ops_prim import scatter_add_ext_op, slice_ext_op, gather_d_op
71
+ from mindspore.ops.auto_generate.gen_ops_prim import scatter_add_ext_op, gather_d_op, slice_op
71
72
  from mindspore.ops.operations.manually_defined import tile, rank, scalar_cast
72
73
  from mindspore.ops.auto_generate.pyboost_inner_prim import _PyboostOneHotExtPrim, tril_ext_impl
74
+ from mindspore._c_expression import pyboost_empty
75
+ from mindspore._c_expression import pyboost_empty_like
76
+ from mindspore._c_expression import pyboost_new_empty
77
+ from mindspore.common._stub_tensor import _convert_stub
73
78
 
74
79
  arg_max_with_value_ = ArgMaxWithValue()
75
80
  arg_min_with_value_ = ArgMinWithValue()
@@ -116,9 +121,10 @@ tensor_scatter_mul_ = P.TensorScatterMul()
116
121
  tensor_scatter_sub_ = P.TensorScatterSub()
117
122
  tensor_select_ = P.Select()
118
123
  tensor_shape_ = P.TensorShape()
119
- tensor_slice = P.Slice()
124
+ tensor_slice = slice_op
120
125
  tile_ = P.Tile()
121
126
  transpose_ = P.Transpose()
127
+ type_as_ = P.TypeAs()
122
128
  tuple_to_array_ = P.TupleToArray()
123
129
  tuple_to_tensor_ = TupleToTensor()
124
130
  unique_ = P.Unique()
@@ -131,10 +137,12 @@ one_hot_ext_impl = _PyboostOneHotExtPrim()
131
137
  zeros_like_ = P.ZerosLike()
132
138
  ones_like_ext_ = OnesLikeExt()
133
139
  zeros_like_ext_ = ZerosLikeExt()
140
+ new_ones_ = NewOnes()
141
+ new_zeros_ = NewZeros()
134
142
  fill_scalar_ = FillScalar()
135
143
  fill_tensor_ = FillTensor()
136
144
  sort_ext_ = SortExt()
137
- scatter_ = Scatter()
145
+ scatter_prim = Scatter()
138
146
  scatter_value_ = ScatterValue()
139
147
  arange_ = Arange()
140
148
  chunk_ = Chunk()
@@ -521,12 +529,97 @@ def where(condition, input, other):
521
529
 
522
530
  def reverse(x, axis):
523
531
  """
524
- :func:`mindspore.ops.reverse` will be deprecated in the future.
525
- Please use :func:`mindspore.ops.flip` instead.
532
+ This interface will be deprecated in the future, and use :func:`mindspore.ops.flip` instead.
526
533
  """
527
534
  return flip(x, axis)
528
535
 
529
536
 
537
+ def empty(*size, dtype=None, device=None):
538
+ r"""
539
+ Creates a tensor with uninitialized data, whose shape, dtype and device are described by the argument `size`,
540
+ `dtype` and `device` respectively.
541
+
542
+ .. warning::
543
+ This is an experimental API that is subject to change or deletion.
544
+
545
+ Args:
546
+ size (Union[tuple[int], list[int], int]): The specified shape of output tensor. Only positive integer or
547
+ tuple or list containing positive integers are allowed.
548
+
549
+ Keyword Args:
550
+ dtype (:class:`mindspore.dtype`, optional): The specified type of output tensor. If `dtype` is ``None`` ,
551
+ `mindspore.float32` will be used. Default: ``None`` .
552
+ device (string, optional): The specified device of the output tensor. Support ``CPU`` and ``Ascend``. If
553
+ `device = None`, the value set by :func:`mindspore.set_device` will be used. Default ``None``.
554
+
555
+ Returns:
556
+ Tensor, whose dtype and size are defined by input.
557
+
558
+ Raises:
559
+ TypeError: If `size` is neither an int nor a tuple or list of int.
560
+
561
+ Supported Platforms:
562
+ ``Ascend``
563
+
564
+ Examples:
565
+ >>> import mindspore
566
+ >>> from mindspore import ops
567
+ >>> output = ops.empty((2, 3), dtype=mindspore.float32)
568
+ >>> print(output)
569
+ [[0. 0. 0.]
570
+ [0. 0. 0.]]
571
+ """
572
+
573
+ return _convert_stub(pyboost_empty([size, dtype, device]))
574
+
575
+ def empty_like(input, *, dtype=None, device=None):
576
+ r"""
577
+ Returns an uninitialized Tensor with the same shape as the `input`. Its dtype is specified by `dtype` and its
578
+ device is specified by `device`.
579
+
580
+ .. warning::
581
+ This is an experimental API that is subject to change or deletion.
582
+
583
+ Args:
584
+ input (Tensor): Tensor of any dimension.
585
+
586
+ Keyword Args:
587
+ dtype (:class:`mindspore.dtype`, optional): The specified dtype of the output tensor. If `dtype = None`, the
588
+ tensor will have the same dtype as input `input`. Default ``None``.
589
+ device (string, optional): The specified device of the output tensor. Support ``CPU`` and ``Ascend``. If
590
+ `device = None`, the tensor will have the same device as input `input` and if the device of the input
591
+ tensor is not defined, the value set by :func:`mindspore.set_device` will be used. Default ``None``.
592
+
593
+ Returns:
594
+ Tensor, has the same shape, type and device as `input` but with uninitialized data (May be a random value).
595
+
596
+ Raises:
597
+ TypeError: If `input` is not a Tensor.
598
+
599
+ Supported Platforms:
600
+ ``Ascend``
601
+
602
+ Examples:
603
+ >>> import mindspore
604
+ >>> from mindspore import ops, Tensor
605
+ >>> x = Tensor([[1, 2, 3], [4, 5, 6]])
606
+ >>> output1 = ops.empty_like(x)
607
+ >>> print(output1)
608
+ [[0 0 0]
609
+ [0 0 0]]
610
+ >>> output2 = ops.empty_like(x, dtype=mindspore.float64)
611
+ >>> print(output2)
612
+ [[0. 0. 0.]
613
+ [0. 0. 0.]]
614
+ """
615
+
616
+ return _convert_stub(pyboost_empty_like([input, dtype, device]))
617
+
618
+
619
+ def new_empty(input, size, dtype, device):
620
+ return _convert_stub(pyboost_new_empty([input, size, dtype, device]))
621
+
622
+
530
623
  def ravel(input):
531
624
  """
532
625
  Expand the multidimensional Tensor into 1D along the 0 axis direction.
@@ -818,7 +911,8 @@ def full_ext(size, fill_value, *, dtype=None): # pylint: disable=redefined-oute
818
911
  Tensor, or a 1-D Tensor with only one element.
819
912
 
820
913
  Keyword Args:
821
- dtype (mindspore.dtype): The specified type of output tensor. `bool_` and `number` are supported, for details,
914
+ dtype (mindspore.dtype, optional): The specified type of output tensor.
915
+ `bool_` and `number` are supported, for details,
822
916
  please refer to :class:`mindspore.dtype` . Default: ``None`` .
823
917
 
824
918
  Returns:
@@ -890,6 +984,50 @@ def full_like(input, fill_value, *, dtype=None):
890
984
  return full(input.shape, fill_value, dtype=dtype)
891
985
 
892
986
 
987
+ def full_like_ext(input, fill_value, *, dtype=None):
988
+ """
989
+ Return a Tensor of the same shape as `input` and filled with `fill_value`.
990
+
991
+ .. warning::
992
+ This is an experimental API that is subject to change or deletion.
993
+
994
+ Args:
995
+ input (Tensor): input Tensor and the output Tensor have the same shape as `input`.
996
+ fill_value (Number): Value to fill the returned tensor. Complex numbers are not supported for now.
997
+
998
+ Keyword Args:
999
+ dtype (mindspore.dtype, optional): The specified type of output tensor. `bool_` and `number` are supported,
1000
+ for details, please refer to :class:`mindspore.dtype` . Default: ``None`` .
1001
+
1002
+ Returns:
1003
+ Tensor.
1004
+
1005
+ Raises:
1006
+ TypeError: If `input` is not a Tensor.
1007
+
1008
+ Supported Platforms:
1009
+ ``Ascend``
1010
+
1011
+ Examples:
1012
+ >>> import mindspore
1013
+ >>> from mindspore import Tensor, mint
1014
+ >>> input = Tensor([[0, 1], [2, 1]], dtype=mindspore.int32)
1015
+ >>> output = mint.full_like(input, 1)
1016
+ >>> print(output)
1017
+ [[1 1]
1018
+ [1 1]]
1019
+ >>> input = Tensor([[0, 1, 1], [2, 1, 2], [1, 3, 4]], dtype=mindspore.int32)
1020
+ >>> output = mint.full_like(input, 0, dtype=mindspore.float32)
1021
+ >>> print(output)
1022
+ [[0. 0. 0.]
1023
+ [0. 0. 0.]
1024
+ [0. 0. 0.]]
1025
+ """
1026
+ if dtype is None:
1027
+ dtype = input.dtype
1028
+ return full_like_op(input, fill_value, dtype)
1029
+
1030
+
893
1031
  def chunk(input, chunks, axis=0):
894
1032
  """
895
1033
  Cut the input Tensor into `chunks` sub-tensors along the specified axis.
@@ -1167,6 +1305,82 @@ def zeros_like_ext(input, *, dtype=None):
1167
1305
  return zeros_like_ext_(input, dtype)
1168
1306
 
1169
1307
 
1308
+ def new_ones(input, size, *, dtype=None):
1309
+ """
1310
+ Return a tensor of `size` filled with ones.
1311
+
1312
+ .. warning::
1313
+ This is an experimental API that is subject to change or deletion.
1314
+
1315
+ Args:
1316
+ input (Tensor): Tensor of any dimension.
1317
+ size (Union[int, tuple(int), list(int)]): An int, list or tuple of integers defining the output shape.
1318
+
1319
+ Keyword Args:
1320
+ dtype (:class:`mindspore.dtype`, optional): The desired dtype of the output tensor. If None, the returned
1321
+ tensor has the same dtype as `self`. Default: ``None``.
1322
+
1323
+ Returns:
1324
+ Tensor, the shape and dtype is defined above and filled with ones.
1325
+
1326
+ Raises:
1327
+ TypeError: If `input` is not a Tensor.
1328
+ TypeError: If `size` is neither an int nor a tuple/list of int.
1329
+ TypeError: If `dtype` is not a MindSpore dtype.
1330
+ ValueError: If `size` contains negative values.
1331
+
1332
+ Supported Platforms:
1333
+ ``Ascend`` ``GPU`` ``CPU``
1334
+
1335
+ Examples:
1336
+ >>> from mindspore import Tensor, ops
1337
+ >>> input = Tensor([1, 2, 3, 4], mindspore.int32)
1338
+ >>> output = ops.function.array_func.new_ones(input, (2, 3))
1339
+ >>> print(output)
1340
+ [[1 1 1]
1341
+ [1 1 1]]
1342
+ """
1343
+ return new_ones_(input, size, dtype)
1344
+
1345
+
1346
+ def new_zeros(input, size, *, dtype=None):
1347
+ """
1348
+ Return a tensor of `size` filled with zeros.
1349
+
1350
+ .. warning::
1351
+ This is an experimental API that is subject to change or deletion.
1352
+
1353
+ Args:
1354
+ input (Tensor): Tensor of any dimension.
1355
+ size (Union[int, tuple(int), list(int)]): An int, list or tuple of integers defining the output shape.
1356
+
1357
+ Keyword Args:
1358
+ dtype (:class:`mindspore.dtype`, optional): The desired dtype of the output tensor. If None, the returned
1359
+ tensor has the same dtype as `self`. Default: ``None``.
1360
+
1361
+ Returns:
1362
+ Tensor, the shape and dtype is defined above and filled with zeros.
1363
+
1364
+ Raises:
1365
+ TypeError: If `input` is not a Tensor.
1366
+ TypeError: If `size` is neither an int nor a tuple/list of int.
1367
+ TypeError: If `dtype` is not a MindSpore dtype.
1368
+ ValueError: If `size` contains negative values.
1369
+
1370
+ Supported Platforms:
1371
+ ``Ascend`` ``GPU`` ``CPU``
1372
+
1373
+ Examples:
1374
+ >>> from mindspore import Tensor, ops
1375
+ >>> input = Tensor([1, 2, 3, 4], mindspore.int32)
1376
+ >>> output = ops.function.array_func.new_zeros(input, (2, 3))
1377
+ >>> print(output)
1378
+ [[0 0 0]
1379
+ [0 0 0]]
1380
+ """
1381
+ return new_zeros_(input, size, dtype)
1382
+
1383
+
1170
1384
  ##############################
1171
1385
  # Tensor Operation Functions.
1172
1386
  ##############################
@@ -1233,16 +1447,17 @@ def unique_ext(input, sorted=True, return_inverse=False, return_counts=False, di
1233
1447
  when `return_inverse=True`, also return a tensor containing the index of each value of input
1234
1448
  tensor corresponding to the output unique tensor.
1235
1449
  when `return_counts=True`, also return a tensor containing the number of occurrences for each
1236
- unique value or tensor
1450
+ unique value or tensor.
1237
1451
 
1238
1452
  Args:
1239
1453
  input (Tensor): The input tensor.
1240
- sorted(bool): Whether to sort the unique elements in ascending order before returning as output.
1454
+ sorted (bool, optional): Whether to sort the unique elements in ascending order before returning as output.
1241
1455
  Default: ``True`` .
1242
- return_inverse(bool): Whether to also return the indices for where elements in the original input ended up in
1456
+ return_inverse (bool, optional): Whether to also return the indices for where elements
1457
+ in the original input ended up in
1243
1458
  the returned unique list. Default: ``False`` .
1244
- return_counts(bool): Whether to also return the counts for each unique element. Default: ``False`` .
1245
- dim(int): the dimension to operate upon. If ``None``, the unique of the flattened input is returned.
1459
+ return_counts (bool, optional): Whether to also return the counts for each unique element. Default: ``False`` .
1460
+ dim (int, optional): the dimension to operate upon. If ``None``, the unique of the flattened input is returned.
1246
1461
  Otherwise, each of the tensors indexed by the given dimension is treated as one of the elements to apply the
1247
1462
  unique operation upon. Default: ``None`` .
1248
1463
 
@@ -1397,11 +1612,10 @@ def unique_consecutive(input, return_idx=False, return_counts=False, axis=None):
1397
1612
  [2 2 1 2 1]
1398
1613
  """
1399
1614
 
1400
- if not isinstance(input, (Tensor, Tensor_)):
1401
- raise TypeError("For 'unique_consecutive', 'input' must be Tensor.")
1402
- unique_consecutive_op = _get_cache_prim(
1403
- UniqueConsecutive)(return_idx, return_counts, axis)
1404
- output, idx, counts = unique_consecutive_op(input)
1615
+ if not F.isconstant(return_idx) or not F.isconstant(return_counts):
1616
+ raise ValueError(
1617
+ f"For 'unique_consecutive', 'return_inverse' and 'return_counts' cannot be mutable")
1618
+ output, idx, counts = unique_consecutive_impl(input, return_idx, return_counts, axis)
1405
1619
  if return_idx and return_counts:
1406
1620
  return output, idx, counts
1407
1621
  if return_idx:
@@ -1928,6 +2142,44 @@ def unbind(input, dim=0):
1928
2142
  return _unstack(input)
1929
2143
 
1930
2144
 
2145
+ def unbind_ext(input, dim=0):
2146
+ r"""
2147
+ Unbind a tensor dimension in specified axis.
2148
+
2149
+ Given a tensor of shape :math:`(n_1, n_2, ..., n_R)` and unbinding it in the specified `dim`,
2150
+ multiple tensors with shape :math:`(n_1, n_2, ..., n_{dim}, n_{dim+2}, ..., n_R)` are returned.
2151
+
2152
+ .. warning::
2153
+ This is an experimental API that is subject to change or deletion.
2154
+
2155
+ Args:
2156
+ input (Tensor): The input tensor to unbind, with a shape of :math:`(n_1, n_2, ..., n_R)`.
2157
+ The rank of the tensor must be greater than 0.
2158
+ dim (int, optional): Dimension along which to unbind. The range is [-R, R). Default: ``0`` .
2159
+
2160
+ Returns:
2161
+ A tuple of tensors, the shape of each objects is the same.
2162
+
2163
+ Raises:
2164
+ TypeError: If `input` is not a Tensor.
2165
+ TypeError: If `dim` is not an int.
2166
+ ValueError: If `dim` is out of the range [-R, R).
2167
+
2168
+ Supported Platforms:
2169
+ ``Ascend``
2170
+
2171
+ Examples:
2172
+ >>> import numpy as np
2173
+ >>> from mindspore import Tensor, ops
2174
+ >>> input = Tensor(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]))
2175
+ >>> output = ops.unbind_ext(input, dim=0)
2176
+ >>> print(output)
2177
+ (Tensor(shape=[3], dtype=Int64, value=[1, 2, 3]), Tensor(shape=[3], dtype=Int64, value=[4, 5, 6]),
2178
+ Tensor(shape=[3], dtype=Int64, value=[7, 8, 9]))
2179
+ """
2180
+ return unstack_ext_op(input, dim)
2181
+
2182
+
1931
2183
  def unsqueeze(input, dim):
1932
2184
  """
1933
2185
  Adds an additional dimension to `input` at the given dim.
@@ -1970,14 +2222,17 @@ def squeeze(input, axis=None):
1970
2222
  If `axis` is specified, it will remove the dimensions of size 1 in the given `axis`.
1971
2223
  For example, if the dimension is not specified :math:`axis=None`, input shape is (A, 1, B, C, 1, D),
1972
2224
  then the shape of the output Tensor is (A, B, C, D). If the dimension is specified, the squeeze operation
1973
- is only performed in the specified dimension. If input shape is (A, 1, B), input Tensor will be changed
1974
- to (A, B) when :math:`axis=1`, but when :math:`axis=0` or :math:`axis=2`, an error will occur.
2225
+ is only performed in the specified dimension. If input shape is (A, 1, B), when :math:`axis=0` or :math:`axis=2`,
2226
+ the input tensor is not changed, while when :math:`axis=1`, the input tensor shape is changed to (A, B).
1975
2227
 
1976
2228
  Note:
1977
- - Squeezing a dimension that is not 1 will raise an error.
1978
2229
  - Please note that in dynamic graph mode, the output Tensor will share data with the input Tensor,
1979
2230
  and there is no Tensor data copy process.
1980
2231
  - The dimension index starts at 0 and must be in the range `[-input.ndim, input.ndim]`.
2232
+ - In GE mode, only support remove dimensions of size 1 from the shape of input tensor.
2233
+
2234
+ .. warning::
2235
+ This is an experimental API that is subject to change or deletion.
1981
2236
 
1982
2237
  Args:
1983
2238
  input (Tensor): The shape of tensor is :math:`(x_1, x_2, ..., x_R)`.
@@ -1992,7 +2247,6 @@ def squeeze(input, axis=None):
1992
2247
  TypeError: If `input` is not a tensor.
1993
2248
  TypeError: If `axis` is not an int, tuple or list.
1994
2249
  TypeError: If `axis` is a tuple or list whose elements are not all int.
1995
- ValueError: If the corresponding dimension of the specified axis isn't equal to 1.
1996
2250
 
1997
2251
  Supported Platforms:
1998
2252
  ``Ascend`` ``GPU`` ``CPU``
@@ -2033,7 +2287,7 @@ def scatter_mul(input_x, indices, updates):
2033
2287
  when the data types of parameters need to be converted.
2034
2288
 
2035
2289
  Args:
2036
- input_x (Parameter): The target tensor to be updated, with data type of Parameter.
2290
+ input_x (Union[Parameter, Tensor]): The target tensor to be updated, with data type of Parameter or Tensor.
2037
2291
  The shape is :math:`(N,*)` where :math:`*` means any number of additional dimensions.
2038
2292
  indices (Tensor): The index to do mul operation whose data type must be int32 or int64.
2039
2293
  updates (Tensor): The tensor doing the mul operation with `input_x`,
@@ -2045,8 +2299,8 @@ def scatter_mul(input_x, indices, updates):
2045
2299
  Raises:
2046
2300
  TypeError: If `indices` is not an int32 or int64.
2047
2301
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2048
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2049
- is required when data type conversion of Parameter is not supported.
2302
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2303
+ is not supported.
2050
2304
 
2051
2305
  Supported Platforms:
2052
2306
  ``Ascend`` ``GPU`` ``CPU``
@@ -2132,7 +2386,7 @@ def scatter_max(input_x, indices, updates):
2132
2386
  required by `input_x`.
2133
2387
 
2134
2388
  Args:
2135
- input_x (Parameter): The target tensor, with data type of Parameter.
2389
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2136
2390
  The shape is :math:`(N, *)` where :math:`*` means, any number of additional dimensions.
2137
2391
  indices (Tensor): The index to do max operation whose data type must be mindspore.int32.
2138
2392
  updates (Tensor): The tensor doing the max operation with `input_x`,
@@ -2144,8 +2398,8 @@ def scatter_max(input_x, indices, updates):
2144
2398
  Raises:
2145
2399
  TypeError: If `indices` is not an int32 or int64.
2146
2400
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2147
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2148
- is required when data type conversion of Parameter is not supported.
2401
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2402
+ is not supported.
2149
2403
  RuntimeError: On the Ascend platform, the input data dimension of `input_x` , `indices`
2150
2404
  and `updates` is greater than 8 dimensions.
2151
2405
 
@@ -2173,7 +2427,7 @@ def scatter_add(input_x, indices, updates):
2173
2427
  This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.
2174
2428
 
2175
2429
  Args:
2176
- input_x (Parameter): The target tensor, with data type of Parameter.
2430
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2177
2431
  indices (Tensor): The index to do add operation whose data type must be int32 or int64.
2178
2432
  updates (Tensor): The tensor doing the add operation with `input_x`,
2179
2433
  the data type is same as `input_x`, the shape is `indices.shape + x.shape[1:]`.
@@ -2184,8 +2438,8 @@ def scatter_add(input_x, indices, updates):
2184
2438
  Raises:
2185
2439
  TypeError: If `indices` is not an int32 or int64.
2186
2440
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2187
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2188
- is required when data type conversion of Parameter is not supported.
2441
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2442
+ is not supported.
2189
2443
 
2190
2444
  Supported Platforms:
2191
2445
  ``Ascend`` ``GPU`` ``CPU``
@@ -2225,7 +2479,7 @@ def scatter_min(input_x, indices, updates):
2225
2479
  when `updates` does not support conversion to the data type required by `input_x`.
2226
2480
 
2227
2481
  Args:
2228
- input_x (Parameter): The target tensor, with data type of Parameter.
2482
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2229
2483
  indices (Tensor): The index to do min operation whose data type must be mindspore.int32 or mindspore.int64.
2230
2484
  updates (Tensor): The tensor doing the min operation with `input_x`,
2231
2485
  the data type is same as `input_x`, the shape is `indices.shape + input_x.shape[1:]`.
@@ -2236,8 +2490,8 @@ def scatter_min(input_x, indices, updates):
2236
2490
  Raises:
2237
2491
  TypeError: If `indices` is not an int32 or an int64.
2238
2492
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2239
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2240
- is required when data type conversion of Parameter is not supported.
2493
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2494
+ is not supported.
2241
2495
  RuntimeError: On the Ascend platform, the input data dimension of `input_x` , `indices`
2242
2496
  and `updates` is greater than 8 dimensions.
2243
2497
 
@@ -2277,7 +2531,7 @@ def scatter_div(input_x, indices, updates):
2277
2531
  when `updates` does not support conversion to the data type required by `input_x`.
2278
2532
 
2279
2533
  Args:
2280
- input_x (Parameter): The target tensor, with data type of Parameter.
2534
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2281
2535
  indices (Tensor): The index to do divide operation whose data type must be mindspore.int32 or
2282
2536
  mindspore.int64.
2283
2537
  updates (Tensor): The tensor doing the divide operation with `input_x`, the data type is same as `input_x`,
@@ -2289,8 +2543,8 @@ def scatter_div(input_x, indices, updates):
2289
2543
  Raises:
2290
2544
  TypeError: If the type of `indices` is not one of the following dtype: int32, int64.
2291
2545
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2292
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter is required
2293
- when data type conversion of Parameter is not supported.
2546
+ RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter or Tensor is required
2547
+ when data type conversion of Parameter or Tensor is not supported.
2294
2548
  RuntimeError: On the Ascend platform, the input data dimension of `input_x` , `indices`
2295
2549
  and `updates` is greater than 8 dimensions.
2296
2550
 
@@ -2363,7 +2617,7 @@ def scatter_update(input_x, indices, updates):
2363
2617
  the relatively highest priority data type.
2364
2618
 
2365
2619
  Args:
2366
- input_x (Parameter): The target tensor, with data type of Parameter.
2620
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2367
2621
  indices (Tensor): The index of input tensor. With int32 or int64 data type.
2368
2622
  If there are duplicates in indices, the order for updating is undefined.
2369
2623
  updates (Tensor): The tensor to update the input tensor, has the same type as input,
@@ -2375,8 +2629,8 @@ def scatter_update(input_x, indices, updates):
2375
2629
  Raises:
2376
2630
  TypeError: If `indices` is not an int32 or an int64.
2377
2631
  ValueError: If the shape of `updates` is not equal to `indices.shape + input_x.shape[1:]`.
2378
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2379
- is required when data type conversion of Parameter is not supported.
2632
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2633
+ is not supported.
2380
2634
 
2381
2635
  Supported Platforms:
2382
2636
  ``Ascend`` ``GPU`` ``CPU``
@@ -2415,7 +2669,7 @@ def scatter_nd_add(input_x, indices, updates, use_locking=False):
2415
2669
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2416
2670
 
2417
2671
  Args:
2418
- input_x (Parameter): The target tensor, with data type of Parameter.
2672
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2419
2673
  indices (Tensor): The index to do min operation whose data type must be mindspore.int32 or mindspore.int64.
2420
2674
  The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2421
2675
  updates (Tensor): The tensor doing the addition operation with `input_x`,
@@ -2430,8 +2684,8 @@ def scatter_nd_add(input_x, indices, updates, use_locking=False):
2430
2684
  TypeError: If the dtype of `indices` is not int32 or int64.
2431
2685
  TypeError: If dtype of `input_x` and `updates` are not the same.
2432
2686
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2433
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2434
- is required when data type conversion of Parameter is not supported.
2687
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2688
+ is not supported.
2435
2689
 
2436
2690
  Supported Platforms:
2437
2691
  ``Ascend`` ``GPU`` ``CPU``
@@ -2490,7 +2744,7 @@ def scatter_nd_sub(input_x, indices, updates, use_locking=False):
2490
2744
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2491
2745
 
2492
2746
  Args:
2493
- input_x (Parameter): The target tensor, with data type of Parameter.
2747
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2494
2748
  indices (Tensor): The index of input tensor, with int32 or int64 data type.
2495
2749
  The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2496
2750
  updates (Tensor): The tensor doing the subtraction operation with `input_x`, has the same type as input.
@@ -2505,8 +2759,8 @@ def scatter_nd_sub(input_x, indices, updates, use_locking=False):
2505
2759
  TypeError: If the dtype of `indices` is not int32 or int64.
2506
2760
  TypeError: If dtype of `input_x` and `updates` are not the same.
2507
2761
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2508
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2509
- is required when data type conversion of Parameter is not supported.
2762
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2763
+ is not supported.
2510
2764
 
2511
2765
  Supported Platforms:
2512
2766
  ``Ascend`` ``GPU`` ``CPU``
@@ -2565,7 +2819,7 @@ def scatter_nd_mul(input_x, indices, updates, use_locking=False):
2565
2819
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2566
2820
 
2567
2821
  Args:
2568
- input_x (Parameter): Input parameter.
2822
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2569
2823
  indices (Tensor): The index to do multiplication operation whose data type must be mindspore.int32 or
2570
2824
  mindspore.int64. The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2571
2825
  updates (Tensor): The tensor to do the multiplication operation with `input_x`.
@@ -2580,8 +2834,8 @@ def scatter_nd_mul(input_x, indices, updates, use_locking=False):
2580
2834
  TypeError: If the dtype of `indices` is not int32 or int64.
2581
2835
  TypeError: If dtype of `input_x` and `updates` are not the same.
2582
2836
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2583
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2584
- is required when data type conversion of Parameter is not supported.
2837
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2838
+ is not supported.
2585
2839
 
2586
2840
  Supported Platforms:
2587
2841
  ``GPU`` ``CPU``
@@ -2640,7 +2894,7 @@ def scatter_nd_div(input_x, indices, updates, use_locking=False):
2640
2894
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2641
2895
 
2642
2896
  Args:
2643
- input_x (Parameter): The target tensor, with data type of Parameter.
2897
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2644
2898
  indices (Tensor): The index to do div operation whose data type must be mindspore.int32 or mindspore.int64.
2645
2899
  The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2646
2900
  updates (Tensor): The tensor to do the div operation with `input_x`.
@@ -2655,8 +2909,8 @@ def scatter_nd_div(input_x, indices, updates, use_locking=False):
2655
2909
  TypeError: If the dtype of `indices` is not int32 or int64.
2656
2910
  TypeError: If dtype of `input_x` and `updates` are not the same.
2657
2911
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2658
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2659
- is required when data type conversion of Parameter is not supported.
2912
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2913
+ is not supported.
2660
2914
 
2661
2915
  Supported Platforms:
2662
2916
  ``GPU`` ``CPU``
@@ -2716,7 +2970,7 @@ def scatter_nd_max(input_x, indices, updates, use_locking=False):
2716
2970
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2717
2971
 
2718
2972
  Args:
2719
- input_x (Parameter): The target tensor, with data type of Parameter.
2973
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2720
2974
  indices (Tensor): The index to do maximum operation whose data type must be mindspore.int32 or mindspore.int64.
2721
2975
  The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2722
2976
  updates (Tensor): The tensor to do the max operation with `input_x`.
@@ -2731,8 +2985,8 @@ def scatter_nd_max(input_x, indices, updates, use_locking=False):
2731
2985
  TypeError: If the dtype of `indices` is not int32 or int64.
2732
2986
  TypeError: If dtype of `input_x` and `updates` are not the same.
2733
2987
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2734
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2735
- is required when data type conversion of Parameter is not supported.
2988
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
2989
+ is not supported.
2736
2990
 
2737
2991
  Supported Platforms:
2738
2992
  ``Ascend`` ``GPU`` ``CPU``
@@ -2791,7 +3045,7 @@ def scatter_nd_min(input_x, indices, updates, use_locking=False):
2791
3045
  :math:`(i_0, i_1, ..., i_{Q-2}, x\_shape_N, ..., x\_shape_{P-1})`.
2792
3046
 
2793
3047
  Args:
2794
- input_x (Parameter): The target tensor, with data type of Parameter.
3048
+ input_x (Union[Parameter, Tensor]): The target tensor, with data type of Parameter or Tensor.
2795
3049
  indices (Tensor): The index to do min operation whose data type must be mindspore.int32 or mindspore.int64.
2796
3050
  The rank of indices must be at least 2 and `indices.shape[-1] <= len(shape)`.
2797
3051
  updates (Tensor): The tensor to do the min operation with `input_x`.
@@ -2806,8 +3060,8 @@ def scatter_nd_min(input_x, indices, updates, use_locking=False):
2806
3060
  TypeError: If the dtype of `indices` is not int32 or int64.
2807
3061
  TypeError: If dtype of `input_x` and `updates` are not the same.
2808
3062
  ValueError: If the shape of `updates` is not equal to `indices.shape[:-1] + x.shape[indices.shape[-1]:]`.
2809
- RuntimeError: If the data type of `input_x` and `updates` conversion of Parameter
2810
- is required when data type conversion of Parameter is not supported.
3063
+ RuntimeError: If the data type of `input_x` and `updates` conversion is required when data type conversion
3064
+ is not supported.
2811
3065
 
2812
3066
  Supported Platforms:
2813
3067
  ``Ascend`` ``GPU`` ``CPU``
@@ -2929,7 +3183,7 @@ def sort_ext(input, *, dim=-1, descending=False, stable=False):
2929
3183
  TypeError: If `descending` is not a bool.
2930
3184
  TypeError: If `input` not in float16, float32, uint8, int8, int16, int32, int64, bfloat16
2931
3185
  TypeError: If `stable` is not a bool.
2932
- ValueError: If `dim` is not in range of [-len(input_x.shape), len(input_x.shape)).
3186
+ ValueError: If `dim` is not in range of [-len(input.shape), len(input.shape)).
2933
3187
 
2934
3188
  Supported Platforms:
2935
3189
  ``Ascend``
@@ -3414,7 +3668,7 @@ def scatter(input, axis, index, src):
3414
3668
  [0. 0. 0. 0. 0.]]
3415
3669
  """
3416
3670
  if isinstance(src, Tensor):
3417
- return scatter_(input, axis, index, src)
3671
+ return scatter_prim(input, axis, index, src)
3418
3672
  return scatter_value_(input, axis, index, src)
3419
3673
 
3420
3674
 
@@ -3435,7 +3689,7 @@ def scatter_add_ext(input, dim, index, src):
3435
3689
 
3436
3690
  Args:
3437
3691
  input (Tensor): The target tensor. The rank must be at least 1.
3438
- dim (int): Which dim to scatter. Accepted range is [-r, r) where r = rank(`input`). Default: ``0``.
3692
+ dim (int): Which dim to scatter. Accepted range is [-r, r) where r = rank(`input`).
3439
3693
  index (Tensor): The index of `input` to do scatter operation whose data type must be mindspore.int32 or
3440
3694
  mindspore.int64. Same rank as `input`. Except for the dimension specified by `dim`,
3441
3695
  the size of each dimension of `index` must be less than or equal to the size of
@@ -3448,10 +3702,10 @@ def scatter_add_ext(input, dim, index, src):
3448
3702
 
3449
3703
  Raises:
3450
3704
  TypeError: If `index` is neither int32 nor int64.
3451
- ValueError: If anyone of the rank among `input`, `index` and `src` less than 1.
3705
+ ValueError: If anyone of the rank among `input`, `index` and `src` is less than 1.
3452
3706
  ValueError: If the rank of `input`, `index` and `src` is not the same.
3453
- ValueError: If, outside dimension `dim`, the size of any dimension of `index` is greater than the size of
3454
- the corresponding dimension of `input` .
3707
+ ValueError: The size of any dimension of `index` except the dimension specified by `dim` is
3708
+ greater than the size of the corresponding dimension of `input`.
3455
3709
  ValueError: If the size of any dimension of `src` is less than that of `index`.
3456
3710
 
3457
3711
  Supported Platforms:
@@ -3988,6 +4242,94 @@ def matrix_set_diag(x, diagonal, k=0, align="RIGHT_LEFT"): # pylint: disable=re
3988
4242
  return matrix_set_diag_v3_op(x, diagonal, k)
3989
4243
 
3990
4244
 
4245
+ def meshgrid_ext(*tensors, indexing='ij'):
4246
+ """
4247
+ Generates coordinate matrices from given coordinate tensors.
4248
+
4249
+ Given N one-dimensional coordinate tensors, returns a tuple outputs of N N-D
4250
+ coordinate tensors for evaluating expressions on an N-D grid.
4251
+
4252
+ .. warning::
4253
+ This is an experimental API that is subject to change or deletion.
4254
+
4255
+ Args:
4256
+ tensors (Union(tuple[Tensor], list[Tensor])): In GRAPH_MODE, a tuple of N 1-D Tensor objects and
4257
+ the length of input should be greater than 1. In PYNATIVE_MODE, a tuple of N 0-D or 1-D Tensor objects
4258
+ and the length of input should be greater than 0. The data type is Number.
4259
+
4260
+ Keyword Args:
4261
+ indexing (str, optional): Cartesian ('xy', default) or
4262
+ matrix ('ij') indexing of output. Valid options: xy' or ``'ij'``. In the 2-D case with
4263
+ inputs of length `M` and `N`, for ``'xy'`` indexing, the shape of outputs is :math:`(N, M)`
4264
+ for ``'ij'`` indexing, the shape of outputs is :math:`(M, N)`. In the 3-D
4265
+ case with inputs of length `M`, `N` and `P`, for ``'xy'`` indexing, the shape of outputs is
4266
+ :math:`(N, M, P)` and for ``'ij'`` indexing, the shape of outputs is :math:`(M, N, P)`.
4267
+ Default: ``'ij'`` .
4268
+
4269
+ Returns:
4270
+ Tensors, a Tuple of N N-D Tensor objects. The data type is the same with the Inputs.
4271
+
4272
+ Raises:
4273
+ TypeError: If `indexing` is not a str or `tensors` is not a tuple.
4274
+ ValueError: If `indexing` is neither ``'xy'`` nor ``'ij'``.
4275
+
4276
+ Supported Platforms:
4277
+ ``Ascend`` ``GPU`` ``CPU``
4278
+
4279
+ Examples:
4280
+ >>> import numpy as np
4281
+ >>> from mindspore import Tensor
4282
+ >>> from mindspore import ops
4283
+ >>> x = Tensor(np.array([1, 2, 3, 4]).astype(np.int32))
4284
+ >>> y = Tensor(np.array([5, 6, 7]).astype(np.int32))
4285
+ >>> z = Tensor(np.array([8, 9, 0, 1, 2]).astype(np.int32))
4286
+ >>> output = ops.meshgrid(x, y, z, indexing='xy')
4287
+ >>> print(output)
4288
+ (Tensor(shape=[3, 4, 5], dtype=Int32, value=
4289
+ [[[1, 1, 1, 1, 1],
4290
+ [2, 2, 2, 2, 2],
4291
+ [3, 3, 3, 3, 3],
4292
+ [4, 4, 4, 4, 4]],
4293
+ [[1, 1, 1, 1, 1],
4294
+ [2, 2, 2, 2, 2],
4295
+ [3, 3, 3, 3, 3],
4296
+ [4, 4, 4, 4, 4]],
4297
+ [[1, 1, 1, 1, 1],
4298
+ [2, 2, 2, 2, 2],
4299
+ [3, 3, 3, 3, 3],
4300
+ [4, 4, 4, 4, 4]]]),
4301
+ Tensor(shape=[3, 4, 5], dtype=Int32, value=
4302
+ [[[5, 5, 5, 5, 5],
4303
+ [5, 5, 5, 5, 5],
4304
+ [5, 5, 5, 5, 5],
4305
+ [5, 5, 5, 5, 5]],
4306
+ [[6, 6, 6, 6, 6],
4307
+ [6, 6, 6, 6, 6],
4308
+ [6, 6, 6, 6, 6],
4309
+ [6, 6, 6, 6, 6]],
4310
+ [[7, 7, 7, 7, 7],
4311
+ [7, 7, 7, 7, 7],
4312
+ [7, 7, 7, 7, 7],
4313
+ [7, 7, 7, 7, 7]]]),
4314
+ Tensor(shape=[3, 4, 5], dtype=Int32, value=
4315
+ [[[8, 9, 0, 1, 2],
4316
+ [8, 9, 0, 1, 2],
4317
+ [8, 9, 0, 1, 2],
4318
+ [8, 9, 0, 1, 2]],
4319
+ [[8, 9, 0, 1, 2],
4320
+ [8, 9, 0, 1, 2],
4321
+ [8, 9, 0, 1, 2],
4322
+ [8, 9, 0, 1, 2]],
4323
+ [[8, 9, 0, 1, 2],
4324
+ [8, 9, 0, 1, 2],
4325
+ [8, 9, 0, 1, 2],
4326
+ [8, 9, 0, 1, 2]]]))
4327
+ """
4328
+ if indexing is None:
4329
+ indexing = 'ij'
4330
+ return meshgrid_impl(tensors, indexing)
4331
+
4332
+
3991
4333
  def meshgrid(*inputs, indexing='xy'):
3992
4334
  """
3993
4335
  Generates coordinate matrices from given coordinate tensors.
@@ -3996,8 +4338,9 @@ def meshgrid(*inputs, indexing='xy'):
3996
4338
  coordinate tensors for evaluating expressions on an N-D grid.
3997
4339
 
3998
4340
  Args:
3999
- inputs (List[Tensor]): List of 1-D tensors.
4000
- The length of inputs should be greater than 1. The data type is Number.
4341
+ inputs (Union(tuple[Tensor], list[Tensor])): In GRAPH_MODE, a tuple of N 1-D Tensor objects and
4342
+ the length of input should be greater than 1. In PYNATIVE_MODE, a tuple of N 0-D or 1-D Tensor objects
4343
+ and the length of input should be greater than 0. The data type is Number.
4001
4344
 
4002
4345
  Keyword Args:
4003
4346
  indexing (str, optional): Cartesian ('xy', default) or
@@ -4067,7 +4410,7 @@ def meshgrid(*inputs, indexing='xy'):
4067
4410
  [8, 9, 0, 1, 2],
4068
4411
  [8, 9, 0, 1, 2]]]))
4069
4412
  """
4070
- meshgrid_op = _get_cache_prim(P.Meshgrid)(indexing)
4413
+ meshgrid_op = _get_cache_prim(Meshgrid)(indexing)
4071
4414
  return meshgrid_op(inputs)
4072
4415
 
4073
4416
 
@@ -4314,6 +4657,58 @@ def index_fill(x, axis, index, value):
4314
4657
  value = cast_(value, x.dtype)
4315
4658
  return index_fill_(x, axis, index, value)
4316
4659
 
4660
+ def index_fill_ext(input, dim, index, value):
4661
+ """
4662
+ Fills the elements under the `dim` dimension of the input Tensor `input` with the input `value`
4663
+ by selecting the indices in the order given in `index`.
4664
+
4665
+ Args:
4666
+ input (Tensor): Input Tensor. The supported data type is Number or Bool.
4667
+ dim (int): Dimension along which to fill the input Tensor. Only supports
4668
+ an int number, which data type is int32 or int64.
4669
+ index (Tensor): Indices of the input Tensor to fill in. The dtype must be int32 or int64.
4670
+ value (Union[bool, int, float, Tensor]): Value to fill the returned Tensor. If `value` is
4671
+ a Tensor, it must be a 0-dimensional Tensor and has the same dtype as `input`. Otherwise,
4672
+ the `value` will be a value with the same data type as `input`.
4673
+
4674
+ Returns:
4675
+ Tensor, has the same dtype and shape as input Tensor.
4676
+
4677
+ Raises:
4678
+ TypeError: If `input` is not a Tensor.
4679
+ TypeError: If `dim` is neither int number nor Tensor.
4680
+ TypeError: When `dim` is a Tensor, its dtype is not int32 or int64.
4681
+ TypeError: If `index` is not a Tensor.
4682
+ TypeError: If dtype of `index` is not int32.
4683
+ TypeError: If `value` is not a bool, int, float, or Tensor.
4684
+ TypeError: When `value` is a Tensor, the dtype of `input` and `value` are not the same.
4685
+ ValueError: If `dim` is a Tensor and its rank is not equal to 0.
4686
+ ValueError: If the rank of `index` is greater than 1D.
4687
+ ValueError: When `value` is a Tensor and its rank is not equal to 0.
4688
+ RuntimeError: If the value of `dim` is out the range of `[-x.ndim, x.ndim - 1]`.
4689
+ RuntimeError: If the values of `index` are out the range of `[-x.shape[dim], x.shape[dim]-1]`.
4690
+
4691
+ Supported Platforms:
4692
+ ``Ascend``
4693
+
4694
+ Examples:
4695
+ >>> import mindspore
4696
+ >>> import numpy as np
4697
+ >>> from mindspore import ops
4698
+ >>> from mindspore import Tensor
4699
+ >>> input = Tensor(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).astype(np.float32))
4700
+ >>> index = Tensor([0, 2], mindspore.int32)
4701
+ >>> value = Tensor(-2.0, mindspore.float32)
4702
+ >>> y = ops.index_fill_ext(x, 1, index, value)
4703
+ >>> print(y)
4704
+ [[-2. 2. -2.]
4705
+ [-2. 5. -2.]
4706
+ [-2. 8. -2.]]
4707
+ """
4708
+ if isinstance(value, Tensor):
4709
+ return index_fill_tensor(input, dim, index, value)
4710
+ return index_fill_scalar(input, dim, index, value)
4711
+
4317
4712
 
4318
4713
  @constexpr
4319
4714
  def _check_check_axis_in_range(axis, ndim):
@@ -4881,30 +5276,30 @@ def split(tensor, split_size_or_sections, axis=0):
4881
5276
  return tuple(res)
4882
5277
 
4883
5278
 
4884
- def split_ext(tensor, split_size_or_sections, axis=0):
5279
+ def split_ext(tensor, split_size, dim=0):
4885
5280
  """
4886
- Splits the Tensor into chunks along the given axis.
5281
+ Splits the Tensor into chunks along the given dim.
4887
5282
 
4888
5283
  Args:
4889
5284
  tensor (Tensor): A Tensor to be divided.
4890
- split_size_or_sections (Union[int, tuple(int), list(int)]):
4891
- If `split_size_or_sections` is an int type, `tensor` will be split into equally sized chunks,
4892
- each chunk with size `split_size_or_sections`. Last chunk will be smaller than `split_size_or_sections`
4893
- if `tensor.shape[axis]` is not divisible by `split_size_or_sections`.
4894
- If `split_size_or_sections` is a list type, then `tensor` will be split into len(split_size_or_sections)
4895
- chunks with sizes `split_size_or_sections` along the given `axis`.
4896
- axis (int): The axis along which to split. Default: ``0`` .
5285
+ split_size (Union[int, tuple(int), list(int)]):
5286
+ If `split_size` is an int type, `tensor` will be split into equally sized chunks,
5287
+ each chunk with size `split_size`. Last chunk will be smaller than `split_size`
5288
+ if `tensor.shape[dim]` is not divisible by `split_size`.
5289
+ If `split_size` is a list type, then `tensor` will be split into len(split_size)
5290
+ chunks with sizes `split_size` along the given `dim`.
5291
+ dim (int): The dim along which to split. Default: ``0`` .
4897
5292
 
4898
5293
  Returns:
4899
5294
  A tuple of sub-tensors.
4900
5295
 
4901
5296
  Raises:
4902
5297
  TypeError: If argument `tensor` is not Tensor.
4903
- TypeError: If argument `axis` is not int.
4904
- ValueError: If argument `axis` is out of range of :[-tensor.ndim, tensor.ndim).
4905
- TypeError: If each element in `split_size_or_sections` is not integer.
4906
- TypeError: If argument `split_size_or_sections` is not int, tuple(int) or list(int).
4907
- ValueError: The sum of `split_size_or_sections` is not equal to x.shape[axis].
5298
+ TypeError: If argument `dim` is not int.
5299
+ ValueError: If argument `dim` is out of range of :[-tensor.ndim, tensor.ndim).
5300
+ TypeError: If each element in `split_size` is not integer.
5301
+ TypeError: If argument `split_size` is not int, tuple(int) or list(int).
5302
+ ValueError: The sum of `split_size` is not equal to x.shape[dim].
4908
5303
 
4909
5304
  Supported Platforms:
4910
5305
  ``Ascend``
@@ -4919,13 +5314,13 @@ def split_ext(tensor, split_size_or_sections, axis=0):
4919
5314
  Tensor(shape=[3], dtype=Float32, value= [ 3.00000000e+00, 4.00000000e+00, 5.00000000e+00]),
4920
5315
  Tensor(shape=[3], dtype=Float32, value= [ 6.00000000e+00, 7.00000000e+00, 8.00000000e+00]))
4921
5316
  """
4922
- if isinstance(split_size_or_sections, int):
4923
- res = split_tensor(tensor, split_size_or_sections, axis)
4924
- elif isinstance(split_size_or_sections, (list, tuple)):
4925
- res = split_with_size(tensor, split_size_or_sections, axis)
5317
+ if isinstance(split_size, int):
5318
+ res = split_tensor(tensor, split_size, dim)
5319
+ elif isinstance(split_size, (list, tuple)):
5320
+ res = split_with_size(tensor, split_size, dim)
4926
5321
  else:
4927
- raise TypeError(f"Type of Argument `split_size_or_sections` should be integer, tuple(int) or list(int), "
4928
- f"but got {type(split_size_or_sections)}")
5322
+ raise TypeError(f"Type of Argument `split_size` should be integer, tuple(int) or list(int), "
5323
+ f"but got {type(split_size)}")
4929
5324
  return res
4930
5325
 
4931
5326
 
@@ -4997,8 +5392,8 @@ def tril_ext(input, diagonal=0):
4997
5392
 
4998
5393
  Args:
4999
5394
  input (Tensor): A Tensor with shape :math:`(x_1, x_2, ..., x_R)`. The rank must be at least 2.
5000
- Supporting all number types including bool.
5001
- diagonal (int, optional): An optional attribute indicates the diagonal to consider, default: 0,
5395
+ Supporting all number types including bool.
5396
+ diagonal (int, optional): An optional attribute indicates the diagonal to consider, default: ``0``,
5002
5397
  indicating the main diagonal.
5003
5398
 
5004
5399
  Returns:
@@ -5195,7 +5590,7 @@ def tensor_split(input, indices_or_sections, axis=0):
5195
5590
  and :math:`axis=0` , the input tensor will be split into sections :math:`input[:1]` ,
5196
5591
  :math:`input[1:4]` , and :math:`input[4:]` .
5197
5592
 
5198
- axis (int): The axis along which to split. Default: ``0`` .
5593
+ axis (int, optional): The axis along which to split. Default: ``0`` .
5199
5594
 
5200
5595
  Returns:
5201
5596
  A tuple of sub-tensors.
@@ -5627,16 +6022,13 @@ def aminmax(input, *, axis=0, keepdims=False):
5627
6022
  argmax_with_value_op = _get_cache_prim(ArgMaxWithValue)(axis, keepdims)
5628
6023
  _, output0 = argmin_with_value_op(input)
5629
6024
  _, output1 = argmax_with_value_op(input)
5630
- if keepdims is True and input.ndim == 0:
5631
- output0 = ops.reshape(output0, [1])
5632
- output1 = ops.reshape(output1, [1])
5633
6025
  return output0, output1
5634
6026
 
5635
6027
 
5636
6028
  def narrow(input, axis, start, length):
5637
6029
  """
5638
- Returns a narrowed tensor from input tensor, and
5639
- the dimension axis is input from start to start + length.
6030
+ Obtains a tensor of a specified length at a
6031
+ specified start position along a specified axis.
5640
6032
 
5641
6033
  Args:
5642
6034
  input (Tensor): the tensor to narrow.
@@ -5682,48 +6074,6 @@ def narrow(input, axis, start, length):
5682
6074
  sizes[axis] = length
5683
6075
  return tensor_slice(input, begins, sizes)
5684
6076
 
5685
-
5686
- def narrow_ext(input, dim, start, length):
5687
- """
5688
- Returns a narrowed tensor from input tensor, and
5689
- the dimension axis is input from start to start + length.
5690
-
5691
- Args:
5692
- input (Tensor): the tensor to narrow.
5693
- dim (int): dimension along which to narrow.
5694
- start (int): the starting dimension.
5695
- length (int): the distance to the ending dimension.
5696
-
5697
- Returns:
5698
- Tensor.
5699
-
5700
- Raises:
5701
- ValueError: If dim is out of range [-input.ndim, input.ndim).
5702
- ValueError: If start is out of range [-input.shape[dim], input.shape[dim]].
5703
- ValueError: It length is out of range [0, input.shape[dim]-start].
5704
-
5705
- Supported Platforms:
5706
- ``Ascend``
5707
-
5708
- Examples:
5709
- >>> import mindspore
5710
- >>> from mindspore import ops
5711
- >>> from mindspore import Tensor
5712
- >>> x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], mindspore.int32)
5713
- >>> output = ops.narrow(x, 0, 0, 2)
5714
- >>> print(output)
5715
- [[ 1 2 3]
5716
- [ 4 5 6]]
5717
- >>> output = ops.narrow(x, 1, 1, 2)
5718
- >>> print(output)
5719
- [[ 2 3]
5720
- [ 5 6]
5721
- [ 8 9]]
5722
- """
5723
- validator.check_value_type("input", input, Tensor, "narrow")
5724
- return slice_ext_op(input, dim, start, start + length, 1)
5725
-
5726
-
5727
6077
  def topk(input, k, dim=None, largest=True, sorted=True):
5728
6078
  r"""
5729
6079
  Finds values and indices of the `k` largest or smallest entries along a given dimension.
@@ -5795,6 +6145,7 @@ def topk(input, k, dim=None, largest=True, sorted=True):
5795
6145
  [3, 0],
5796
6146
  [0, 1]]))
5797
6147
  """
6148
+ validator.check_value_type("largest", largest, [bool], "topk")
5798
6149
  top_k_ = _get_cache_prim(P.TopK)(sorted)
5799
6150
  if not largest:
5800
6151
  input = -input
@@ -5817,8 +6168,7 @@ def topk(input, k, dim=None, largest=True, sorted=True):
5817
6168
 
5818
6169
  def expand(input_x, size):
5819
6170
  r"""
5820
- :func:`mindspore.ops.expand` will be deprecated in the future.
5821
- Please use :func:`mindspore.ops.broadcast_to` instead.
6171
+ This interface will be deprecated in the future, and use :func:`mindspore.ops.broadcast_to` instead.
5822
6172
  """
5823
6173
  expand_op = _get_cache_prim(Expand)()
5824
6174
  return expand_op(input_x, size)
@@ -6214,17 +6564,21 @@ def mvlgamma(input, p):
6214
6564
  return mvlgamma_op(input)
6215
6565
 
6216
6566
 
6217
- def nonzero(input, as_tuple=False):
6567
+ def nonzero(input, *, as_tuple=False):
6218
6568
  r"""
6219
6569
  Return the positions of all non-zero values.
6220
6570
 
6221
6571
  Args:
6222
- input (Tensor): The input Tensor, its rank should be greater than or equal to 1.
6572
+ input (Tensor): The input Tensor.
6573
+
6574
+ - Ascend: its rank can be equal to 0 except O2 mode.
6575
+ - CPU/GPU: its rank should be greater than or eaqual to 1.
6576
+
6577
+ Keyword Args:
6223
6578
  as_tuple (bool, optional): Whether the output is tuple.
6224
6579
  If ``False`` , return Tensor. Default: ``False`` .
6225
6580
  If ``True`` , return Tuple of Tensor, only support ``Ascend`` .
6226
6581
 
6227
-
6228
6582
  Returns:
6229
6583
  - If `as_tuple` is ``False``, return the Tensor, a 2-D Tensor whose data type is int64,
6230
6584
  containing the positions of all non-zero values of the input.
@@ -6236,7 +6590,7 @@ def nonzero(input, as_tuple=False):
6236
6590
  Raises:
6237
6591
  TypeError: If `input` is not Tensor.
6238
6592
  TypeError: If `as_tuple` is not bool.
6239
- ValueError: If dim of `input` equals to 0.
6593
+ RuntimeError: On GPU or CPU or Ascend O2 mode, if dim of `input` equals to 0.
6240
6594
 
6241
6595
  Supported Platforms:
6242
6596
  ``Ascend`` ``GPU`` ``CPU``
@@ -6251,22 +6605,25 @@ def nonzero(input, as_tuple=False):
6251
6605
  [[0 0 0]
6252
6606
  [0 1 0]]
6253
6607
  >>> x = Tensor(np.array([1, 0, 2, 0, 3]), mindspore.int32)
6254
- >>> output = ops.nonzero(x, False)
6608
+ >>> output = ops.nonzero(x, as_tuple=False)
6255
6609
  >>> print(output)
6256
6610
  [[0]
6257
6611
  [2]
6258
6612
  [4]]
6259
6613
  >>> x = Tensor(np.array([[[1, 0], [-5, 0]]]), mindspore.int32)
6260
- >>> output = ops.nonzero(x, True)
6614
+ >>> output = ops.nonzero(x, as_tuple=True)
6261
6615
  >>> print(output)
6262
6616
  (Tensor(shape=[2], dtype=Int64, value=[0, 0]),
6263
6617
  Tensor(shape=[2], dtype=Int64, value=[0, 1]),
6264
6618
  Tensor(shape=[2], dtype=Int64, value=[0, 0]))
6265
6619
  >>> x = Tensor(np.array([1, 0, 2, 0, 3]), mindspore.int32)
6266
- >>> output = ops.nonzero(x, True)
6620
+ >>> output = ops.nonzero(x, as_tuple=True)
6267
6621
  >>> print(output)
6268
6622
  (Tensor(shape=[3], dtype=Int64, value=[0, 2, 4]), )
6269
6623
  """
6624
+ if not isinstance(as_tuple, bool):
6625
+ raise TypeError(
6626
+ f"For array function 'nonzero', 'as_tuple' must be bool, but got {type(as_tuple)}.")
6270
6627
  if as_tuple:
6271
6628
  return non_zero_ext_(input)
6272
6629
  return non_zero_(input)
@@ -6651,7 +7008,7 @@ def _check_rank_range(x_rank, limit, arg_name, op_name):
6651
7008
 
6652
7009
  def repeat_interleave(input, repeats, axis=None):
6653
7010
  """
6654
- Repeat elements of a tensor along an axis, like `numpy.repeat`.
7011
+ Repeat elements of a tensor along an axis, like :func:`mindspore.numpy.repeat`.
6655
7012
 
6656
7013
  Args:
6657
7014
  input (Tensor): The tensor to repeat values for. Must be of type: float16,
@@ -6691,7 +7048,7 @@ def repeat_interleave(input, repeats, axis=None):
6691
7048
 
6692
7049
  def repeat_interleave_ext(input, repeats, dim=None, output_size=None):
6693
7050
  r"""
6694
- Repeat elements of a tensor along an axis, like `numpy.repeat`.
7051
+ Repeat elements of a tensor along an axis, like :func:`mindspore.numpy.repeat`.
6695
7052
 
6696
7053
  .. warning::
6697
7054
  Only support on Atlas A2 training series.
@@ -6732,7 +7089,7 @@ def repeat_interleave_ext(input, repeats, dim=None, output_size=None):
6732
7089
 
6733
7090
  def repeat_elements(x, rep, axis=0):
6734
7091
  """
6735
- Repeat elements of a tensor along an axis, like `numpy.repeat` .
7092
+ Repeat elements of a tensor along an axis, like :func:`mindspore.numpy.repeat` .
6736
7093
 
6737
7094
  Note:
6738
7095
  It is recommended to use :func:'mindspore.mint.repeat_interleave', the dimension of input 'x' can support
@@ -6909,10 +7266,9 @@ def gather_ext(input, dim, index):
6909
7266
  >>> import mindspore
6910
7267
  >>> import numpy as np
6911
7268
  >>> from mindspore import Tensor, ops
6912
- >>> from mindspore.ops.function.array_func import gather_ext
6913
7269
  >>> input = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mindspore.float32)
6914
7270
  >>> index = Tensor(np.array([[0, 0], [1, 1]]), mindspore.int32)
6915
- >>> output = gather_ext(input, 1, index)
7271
+ >>> output = ops.function.array_func.gather_ext(input, 1, index)
6916
7272
  >>> print(output)
6917
7273
  [[-0.1 -0.1]
6918
7274
  [0.5 0.5]]
@@ -6954,10 +7310,9 @@ def max_ext(input, dim=None, keepdim=False):
6954
7310
  >>> import mindspore
6955
7311
  >>> import numpy as np
6956
7312
  >>> from mindspore import Tensor, ops
6957
- >>> from mindspore.ops.function.array_func import max_ext
6958
7313
  >>> y = Tensor(np.array([[0.0, 0.3, 0.4, 0.5, 0.1],
6959
7314
  ... [3.2, 0.4, 0.1, 2.9, 4.0]]), mindspore.float32)
6960
- >>> output, index = max_ext(y, 0, True)
7315
+ >>> output, index = ops.function.array_func.max_ext(y, 0, True)
6961
7316
  >>> print(output, index)
6962
7317
  [[3.2 0.4 0.4 2.9 4. ]] [[1 1 0 1 1]]
6963
7318
  """
@@ -7005,9 +7360,8 @@ def min_ext(input, dim=None, keepdim=False):
7005
7360
  >>> import mindspore
7006
7361
  >>> import numpy as np
7007
7362
  >>> from mindspore import Tensor, ops
7008
- >>> from mindspore.ops.function.array_func import min_ext
7009
7363
  >>> x = Tensor(np.array([0.0, 0.4, 0.6, 0.7, 0.1]), mindspore.float32)
7010
- >>> output, index = min_ext(x, 0, keepdim=True)
7364
+ >>> output, index = ops.function.array_func.min_ext(x, 0, keepdim=True)
7011
7365
  >>> print(output, index)
7012
7366
  [0.0] [0]
7013
7367
  """
@@ -7085,6 +7439,51 @@ def from_numpy(array):
7085
7439
  """
7086
7440
  return Tensor.from_numpy(array)
7087
7441
 
7442
+
7443
+ def type_as(input, other):
7444
+ r"""
7445
+ Returns input cast to the type of the with the other.
7446
+
7447
+ .. warning::
7448
+ This is an experimental API that is subject to change or deletion.
7449
+
7450
+ Note:
7451
+ When converting complex numbers to boolean type, the imaginary part of the complex number is not
7452
+ taken into account. As long as the real part is non-zero, it returns True; otherwise, it returns False.
7453
+
7454
+ Args:
7455
+ input (Tensor): The shape of tensor is :math:`(x_0, x_1, ..., x_R)`.
7456
+ The tensor whose data type is to be converted.
7457
+ other (Tensor): The shape of tensor is :math:`(x_0, x_1, ..., x_R)`.
7458
+ The tensor whose data type is specified.
7459
+
7460
+ Returns:
7461
+ Tensor, the shape of tensor is the same as `input`, :math:`(x_0, x_1, ..., x_R)`.
7462
+
7463
+ Raises:
7464
+ TypeError: If `input` is not a Tensor.
7465
+ TypeError: If `other` is not a Tensor.
7466
+
7467
+ Supported Platforms:
7468
+ ``Ascend``
7469
+
7470
+ Examples:
7471
+ >>> import mindspore
7472
+ >>> import numpy as np
7473
+ >>> from mindspore import Tensor, ops
7474
+ >>> input_np = np.random.randn(2, 3, 4, 5).astype(np.float32)
7475
+ >>> input = Tensor(input_np)
7476
+ >>> other_np = np.random.randn(2, 3, 4).astype(np.int32)
7477
+ >>> other = Tensor(other_np)
7478
+ >>> output = ops.type_as(input, other)
7479
+ >>> print(output.dtype)
7480
+ Int32
7481
+ >>> print(output.shape)
7482
+ (2, 3, 4, 5)
7483
+ """
7484
+ return type_as_(input, other)
7485
+
7486
+
7088
7487
  __all__ = [
7089
7488
  'unique',
7090
7489
  'unique_with_pad',
@@ -7224,5 +7623,8 @@ __all__ = [
7224
7623
  'top_k',
7225
7624
  'deepcopy',
7226
7625
  'flip',
7626
+ 'view_as',
7627
+ 'type_as',
7628
+ 'expand_as',
7227
7629
  ]
7228
7630
  __all__.sort()