mindspore 2.6.0__cp311-cp311-win_amd64.whl → 2.7.0__cp311-cp311-win_amd64.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 (455) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
  3. mindspore/Newtonsoft.Json.dll +0 -0
  4. mindspore/__init__.py +2 -2
  5. mindspore/_c_dataengine.cp311-win_amd64.pyd +0 -0
  6. mindspore/_c_expression.cp311-win_amd64.pyd +0 -0
  7. mindspore/_c_mindrecord.cp311-win_amd64.pyd +0 -0
  8. mindspore/_checkparam.py +42 -11
  9. mindspore/_extends/builtin_operations.py +3 -3
  10. mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
  11. mindspore/_extends/optimize/cell_utils.py +96 -0
  12. mindspore/_extends/parallel_compile/akg_compiler/custom.py +1109 -0
  13. mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
  14. mindspore/_extends/parse/__init__.py +3 -3
  15. mindspore/_extends/parse/compile_config.py +44 -22
  16. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -2
  17. mindspore/_extends/parse/parser.py +64 -83
  18. mindspore/_extends/parse/resources.py +39 -0
  19. mindspore/_extends/parse/standard_method.py +47 -14
  20. mindspore/_extends/parse/trope.py +8 -1
  21. mindspore/_extends/pijit/__init__.py +1 -2
  22. mindspore/_extends/pijit/pijit_func_white_list.py +2 -5
  23. mindspore/amp.py +4 -22
  24. mindspore/atlprov.dll +0 -0
  25. mindspore/avcodec-59.dll +0 -0
  26. mindspore/avdevice-59.dll +0 -0
  27. mindspore/avfilter-8.dll +0 -0
  28. mindspore/avformat-59.dll +0 -0
  29. mindspore/avutil-57.dll +0 -0
  30. mindspore/boost/adasum.py +1 -1
  31. mindspore/boost/boost_cell_wrapper.py +4 -4
  32. mindspore/c1.dll +0 -0
  33. mindspore/c1xx.dll +0 -0
  34. mindspore/c2.dll +0 -0
  35. mindspore/common/__init__.py +43 -12
  36. mindspore/common/_grad_function.py +2 -1
  37. mindspore/common/_pijit_context.py +28 -7
  38. mindspore/common/_stub_tensor.py +1 -209
  39. mindspore/common/_tensor_cpp_method.py +1 -1
  40. mindspore/common/_tensor_docs.py +177 -52
  41. mindspore/common/_utils.py +9 -1
  42. mindspore/common/api.py +338 -208
  43. mindspore/common/dtype.py +108 -57
  44. mindspore/common/dump.py +11 -16
  45. mindspore/common/dynamic_shape/__init__.py +0 -0
  46. mindspore/common/{auto_dynamic_shape.py → dynamic_shape/auto_dynamic_shape.py} +17 -23
  47. mindspore/common/dynamic_shape/enable_dynamic.py +197 -0
  48. mindspore/common/file_system.py +59 -9
  49. mindspore/common/generator.py +2 -3
  50. mindspore/common/hook_handle.py +33 -5
  51. mindspore/common/jit_config.py +1 -1
  52. mindspore/common/jit_trace.py +84 -105
  53. mindspore/common/np_dtype.py +3 -3
  54. mindspore/common/parameter.py +27 -29
  55. mindspore/common/recompute.py +5 -7
  56. mindspore/common/sparse_tensor.py +0 -3
  57. mindspore/common/symbol.py +0 -1
  58. mindspore/common/tensor.py +84 -133
  59. mindspore/communication/_comm_helper.py +46 -4
  60. mindspore/communication/management.py +79 -7
  61. mindspore/context.py +47 -38
  62. mindspore/dataset/__init__.py +1 -1
  63. mindspore/dataset/audio/transforms.py +1 -1
  64. mindspore/dataset/core/config.py +38 -4
  65. mindspore/dataset/engine/datasets.py +350 -322
  66. mindspore/dataset/engine/datasets_user_defined.py +69 -23
  67. mindspore/dataset/engine/iterators.py +2 -2
  68. mindspore/dataset/engine/obs/config_loader.py +2 -2
  69. mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
  70. mindspore/dataset/transforms/c_transforms.py +2 -2
  71. mindspore/dataset/transforms/py_transforms.py +7 -3
  72. mindspore/dataset/transforms/transforms.py +10 -6
  73. mindspore/dataset/vision/__init__.py +1 -1
  74. mindspore/dataset/vision/py_transforms.py +8 -8
  75. mindspore/dataset/vision/transforms.py +17 -5
  76. mindspore/dataset/vision/utils.py +632 -21
  77. mindspore/dataset/vision/validators.py +1 -0
  78. mindspore/device_context/ascend/device.py +1 -1
  79. mindspore/device_context/ascend/op_tuning.py +35 -1
  80. mindspore/device_context/gpu/__init__.py +2 -2
  81. mindspore/device_context/gpu/device.py +1 -1
  82. mindspore/device_context/gpu/op_precision.py +4 -2
  83. mindspore/device_context/gpu/op_tuning.py +6 -3
  84. mindspore/device_manager.py +16 -9
  85. mindspore/dnnl.dll +0 -0
  86. mindspore/dpcmi.dll +0 -0
  87. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +5 -4
  88. mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
  89. mindspore/experimental/optim/adadelta.py +13 -20
  90. mindspore/experimental/optim/adagrad.py +15 -22
  91. mindspore/experimental/optim/adam.py +17 -24
  92. mindspore/experimental/optim/adamax.py +14 -22
  93. mindspore/experimental/optim/adamw.py +28 -34
  94. mindspore/experimental/optim/asgd.py +15 -25
  95. mindspore/experimental/optim/lr_scheduler.py +27 -45
  96. mindspore/experimental/optim/nadam.py +14 -24
  97. mindspore/experimental/optim/optimizer.py +13 -23
  98. mindspore/experimental/optim/radam.py +18 -24
  99. mindspore/experimental/optim/rmsprop.py +14 -25
  100. mindspore/experimental/optim/rprop.py +15 -26
  101. mindspore/experimental/optim/sgd.py +9 -19
  102. mindspore/hal/__init__.py +4 -4
  103. mindspore/hal/contiguous_tensors_handle.py +2 -2
  104. mindspore/hal/memory.py +1 -0
  105. mindspore/include/api/cell.h +65 -5
  106. mindspore/include/api/cfg.h +24 -7
  107. mindspore/include/api/context.h +1 -0
  108. mindspore/include/api/delegate.h +10 -2
  109. mindspore/include/api/dual_abi_helper.h +100 -19
  110. mindspore/include/api/graph.h +14 -1
  111. mindspore/include/api/kernel.h +16 -3
  112. mindspore/include/api/kernel_api.h +9 -1
  113. mindspore/include/api/metrics/accuracy.h +9 -0
  114. mindspore/include/api/model.h +8 -1
  115. mindspore/include/api/model_group.h +4 -0
  116. mindspore/include/api/model_parallel_runner.h +2 -0
  117. mindspore/include/api/status.h +48 -10
  118. mindspore/include/api/types.h +8 -3
  119. mindspore/include/c_api/model_c.h +0 -58
  120. mindspore/include/c_api/tensor_c.h +0 -26
  121. mindspore/include/dataset/constants.h +9 -0
  122. mindspore/include/dataset/vision_ascend.h +1 -1
  123. mindspore/jpeg62.dll +0 -0
  124. mindspore/mindrecord/tools/cifar10.py +61 -11
  125. mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
  126. mindspore/mindspore_backend_common.dll +0 -0
  127. mindspore/mindspore_backend_manager.dll +0 -0
  128. mindspore/mindspore_common.dll +0 -0
  129. mindspore/mindspore_core.dll +0 -0
  130. mindspore/mindspore_cpu_res_manager.dll +0 -0
  131. mindspore/mindspore_dump.dll +0 -0
  132. mindspore/mindspore_frontend.dll +0 -0
  133. mindspore/mindspore_glog.dll +0 -0
  134. mindspore/mindspore_memory_pool.dll +0 -0
  135. mindspore/mindspore_ms_backend.dll +0 -0
  136. mindspore/mindspore_ops.dll +0 -0
  137. mindspore/mindspore_ops_host.dll +0 -0
  138. mindspore/mindspore_ops_kernel_common.dll +0 -0
  139. mindspore/mindspore_profiler.dll +0 -0
  140. mindspore/mindspore_pyboost.dll +0 -0
  141. mindspore/mindspore_pynative.dll +0 -0
  142. mindspore/mindspore_res_manager.dll +0 -0
  143. mindspore/mindspore_runtime_pipeline.dll +0 -0
  144. mindspore/mint/__init__.py +4 -44
  145. mindspore/mint/distributed/__init__.py +5 -0
  146. mindspore/mint/distributed/distributed.py +425 -19
  147. mindspore/mint/nn/__init__.py +1 -1
  148. mindspore/mint/nn/functional.py +53 -6
  149. mindspore/mint/nn/layer/_functions.py +163 -294
  150. mindspore/mint/nn/layer/activation.py +8 -6
  151. mindspore/mint/nn/layer/conv.py +125 -101
  152. mindspore/mint/nn/layer/normalization.py +11 -25
  153. mindspore/mint/optim/adam.py +19 -18
  154. mindspore/mint/optim/adamw.py +14 -8
  155. mindspore/mint/optim/sgd.py +5 -5
  156. mindspore/msobj140.dll +0 -0
  157. mindspore/mspdb140.dll +0 -0
  158. mindspore/mspdbcore.dll +0 -0
  159. mindspore/mspdbst.dll +0 -0
  160. mindspore/mspft140.dll +0 -0
  161. mindspore/msvcdis140.dll +0 -0
  162. mindspore/msvcp140_1.dll +0 -0
  163. mindspore/msvcp140_2.dll +0 -0
  164. mindspore/msvcp140_atomic_wait.dll +0 -0
  165. mindspore/msvcp140_codecvt_ids.dll +0 -0
  166. mindspore/nn/cell.py +488 -620
  167. mindspore/nn/grad/cell_grad.py +11 -12
  168. mindspore/nn/layer/activation.py +36 -36
  169. mindspore/nn/layer/basic.py +74 -77
  170. mindspore/nn/layer/channel_shuffle.py +4 -4
  171. mindspore/nn/layer/combined.py +4 -2
  172. mindspore/nn/layer/conv.py +86 -85
  173. mindspore/nn/layer/dense.py +9 -7
  174. mindspore/nn/layer/embedding.py +50 -52
  175. mindspore/nn/layer/image.py +38 -40
  176. mindspore/nn/layer/math.py +111 -112
  177. mindspore/nn/layer/normalization.py +56 -44
  178. mindspore/nn/layer/pooling.py +58 -63
  179. mindspore/nn/layer/rnn_cells.py +33 -33
  180. mindspore/nn/layer/rnns.py +56 -56
  181. mindspore/nn/layer/thor_layer.py +74 -73
  182. mindspore/nn/layer/transformer.py +11 -1
  183. mindspore/nn/learning_rate_schedule.py +20 -20
  184. mindspore/nn/loss/loss.py +79 -81
  185. mindspore/nn/optim/adam.py +2 -4
  186. mindspore/nn/optim/adasum.py +2 -2
  187. mindspore/nn/optim/lamb.py +1 -3
  188. mindspore/nn/optim/optimizer.py +1 -1
  189. mindspore/nn/optim/tft_wrapper.py +2 -3
  190. mindspore/nn/optim/thor.py +2 -2
  191. mindspore/nn/probability/distribution/_utils/utils.py +2 -2
  192. mindspore/nn/probability/distribution/exponential.py +2 -1
  193. mindspore/nn/probability/distribution/poisson.py +2 -1
  194. mindspore/nn/sparse/sparse.py +3 -3
  195. mindspore/nn/wrap/cell_wrapper.py +73 -42
  196. mindspore/nn/wrap/grad_reducer.py +37 -52
  197. mindspore/nn/wrap/loss_scale.py +72 -74
  198. mindspore/numpy/array_creations.py +7 -7
  199. mindspore/numpy/fft.py +1 -1
  200. mindspore/numpy/math_ops.py +1 -1
  201. mindspore/numpy/utils_const.py +1 -1
  202. mindspore/opencv_core452.dll +0 -0
  203. mindspore/opencv_imgcodecs452.dll +0 -0
  204. mindspore/opencv_imgproc452.dll +0 -0
  205. mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
  206. mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
  207. mindspore/ops/_grad_experimental/grad_inner_ops.py +0 -9
  208. mindspore/ops/_op_impl/cpu/__init__.py +1 -0
  209. mindspore/{experimental/es/__init__.py → ops/_op_impl/cpu/joinedstr_op.py} +12 -6
  210. mindspore/ops/_vmap/vmap_array_ops.py +6 -13
  211. mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
  212. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +29 -10
  213. mindspore/ops/auto_generate/gen_extend_func.py +5 -55
  214. mindspore/ops/auto_generate/gen_ops_def.py +753 -273
  215. mindspore/ops/auto_generate/gen_ops_prim.py +1687 -958
  216. mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
  217. mindspore/ops/composite/__init__.py +10 -0
  218. mindspore/ops/composite/base.py +9 -5
  219. mindspore/ops/composite/multitype_ops/__init__.py +12 -1
  220. mindspore/ops/composite/multitype_ops/_compile_utils.py +132 -108
  221. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
  222. mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
  223. mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
  224. mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
  225. mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
  226. mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
  227. mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
  228. mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
  229. mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
  230. mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
  231. mindspore/ops/function/__init__.py +4 -1
  232. mindspore/ops/function/_add_attr_func.py +11 -6
  233. mindspore/ops/function/array_func.py +17 -100
  234. mindspore/ops/function/debug_func.py +8 -5
  235. mindspore/ops/function/grad/grad_func.py +5 -13
  236. mindspore/ops/function/math_func.py +65 -399
  237. mindspore/ops/function/nn_func.py +44 -61
  238. mindspore/ops/function/other_func.py +4 -1
  239. mindspore/ops/function/random_func.py +31 -4
  240. mindspore/ops/functional.py +2 -3
  241. mindspore/ops/functional_overload.py +486 -18
  242. mindspore/ops/op_info_register.py +21 -0
  243. mindspore/ops/operations/__init__.py +5 -2
  244. mindspore/ops/operations/_custom_ops_utils.py +675 -8
  245. mindspore/ops/operations/_inner_ops.py +14 -18
  246. mindspore/ops/operations/_sequence_ops.py +1 -1
  247. mindspore/ops/operations/array_ops.py +4 -50
  248. mindspore/ops/operations/comm_ops.py +186 -41
  249. mindspore/ops/operations/custom_ops.py +244 -175
  250. mindspore/ops/operations/debug_ops.py +55 -4
  251. mindspore/ops/operations/image_ops.py +13 -13
  252. mindspore/ops/operations/manually_defined/ops_def.py +27 -28
  253. mindspore/ops/operations/math_ops.py +8 -9
  254. mindspore/ops/operations/nn_ops.py +6 -7
  255. mindspore/ops/primitive.py +9 -20
  256. mindspore/ops/tensor_method.py +52 -11
  257. mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
  258. mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
  259. mindspore/ops_generate/api/functions_cc_generator.py +58 -10
  260. mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
  261. mindspore/ops_generate/common/base_generator.py +14 -0
  262. mindspore/ops_generate/common/gen_constants.py +7 -2
  263. mindspore/ops_generate/common/gen_utils.py +0 -19
  264. mindspore/ops_generate/common/op_proto.py +11 -4
  265. mindspore/ops_generate/common/template.py +88 -11
  266. mindspore/ops_generate/gen_ops.py +1 -1
  267. mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
  268. mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
  269. mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
  270. mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
  271. mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
  272. mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
  273. mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -16
  274. mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
  275. mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
  276. mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
  277. mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
  278. mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
  279. mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
  280. mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
  281. mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
  282. mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
  283. mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
  284. mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
  285. mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
  286. mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
  287. mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
  288. mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
  289. mindspore/parallel/_auto_parallel_context.py +9 -17
  290. mindspore/parallel/_cell_wrapper.py +106 -40
  291. mindspore/parallel/_parallel_serialization.py +4 -3
  292. mindspore/parallel/_ps_context.py +4 -6
  293. mindspore/parallel/_tensor.py +167 -12
  294. mindspore/parallel/_transformer/moe.py +1 -1
  295. mindspore/parallel/_transformer/transformer.py +17 -12
  296. mindspore/parallel/_utils.py +5 -11
  297. mindspore/parallel/auto_parallel.py +33 -12
  298. mindspore/parallel/checkpoint_convert.py +3 -3
  299. mindspore/parallel/checkpoint_transform.py +5 -1
  300. mindspore/parallel/cluster/process_entity/_api.py +88 -49
  301. mindspore/parallel/cluster/process_entity/_utils.py +95 -7
  302. mindspore/parallel/cluster/run.py +48 -7
  303. mindspore/parallel/function/__init__.py +8 -1
  304. mindspore/parallel/function/reshard_func.py +7 -6
  305. mindspore/parallel/nn/__init__.py +15 -2
  306. mindspore/parallel/nn/parallel_cell_wrapper.py +50 -14
  307. mindspore/parallel/nn/parallel_grad_reducer.py +7 -14
  308. mindspore/parallel/shard.py +9 -23
  309. mindspore/parallel/transform_safetensors.py +468 -174
  310. mindspore/pgodb140.dll +0 -0
  311. mindspore/pgort140.dll +0 -0
  312. mindspore/profiler/__init__.py +2 -1
  313. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
  314. mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
  315. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +3 -0
  316. mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
  317. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
  318. mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
  319. mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
  320. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
  321. mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
  322. mindspore/profiler/analysis/task_manager.py +1 -1
  323. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
  324. mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
  325. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +10 -9
  326. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +43 -23
  327. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
  328. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
  329. mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
  330. mindspore/profiler/common/constant.py +16 -0
  331. mindspore/profiler/common/msprof_cmd_tool.py +2 -2
  332. mindspore/profiler/common/path_manager.py +9 -0
  333. mindspore/profiler/common/profiler_context.py +50 -29
  334. mindspore/profiler/common/profiler_info.py +0 -16
  335. mindspore/profiler/common/profiler_meta_data.py +1 -0
  336. mindspore/profiler/common/profiler_op_analyse.py +239 -0
  337. mindspore/profiler/common/profiler_output_path.py +23 -8
  338. mindspore/profiler/common/profiler_parameters.py +128 -35
  339. mindspore/profiler/dynamic_profile/__init__.py +0 -0
  340. mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
  341. mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
  342. mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
  343. mindspore/profiler/dynamic_profiler.py +374 -338
  344. mindspore/profiler/envprofiler.py +42 -12
  345. mindspore/profiler/experimental_config.py +112 -7
  346. mindspore/profiler/mstx.py +33 -12
  347. mindspore/profiler/platform/__init__.py +2 -3
  348. mindspore/profiler/platform/cpu_profiler.py +10 -4
  349. mindspore/profiler/platform/npu_profiler.py +30 -20
  350. mindspore/profiler/profiler.py +218 -154
  351. mindspore/profiler/profiler_action_controller.py +65 -77
  352. mindspore/profiler/profiler_interface.py +2 -2
  353. mindspore/profiler/schedule.py +10 -4
  354. mindspore/rewrite/common/config.py +1 -0
  355. mindspore/rewrite/common/namer.py +1 -0
  356. mindspore/rewrite/common/namespace.py +1 -0
  357. mindspore/rewrite/node/node.py +31 -11
  358. mindspore/rewrite/parsers/assign_parser.py +1 -1
  359. mindspore/rewrite/symbol_tree/symbol_tree.py +2 -2
  360. mindspore/run_check/_check_version.py +7 -10
  361. mindspore/runtime/__init__.py +8 -6
  362. mindspore/runtime/event.py +10 -4
  363. mindspore/runtime/executor.py +87 -45
  364. mindspore/runtime/memory.py +22 -30
  365. mindspore/runtime/thread_bind_core.py +299 -165
  366. mindspore/safeguard/rewrite_obfuscation.py +12 -13
  367. mindspore/swresample-4.dll +0 -0
  368. mindspore/swscale-6.dll +0 -0
  369. mindspore/tbbmalloc.dll +0 -0
  370. mindspore/tinyxml2.dll +0 -0
  371. mindspore/train/_utils.py +9 -5
  372. mindspore/train/amp.py +43 -23
  373. mindspore/train/callback/__init__.py +5 -5
  374. mindspore/train/callback/_callback.py +2 -1
  375. mindspore/train/callback/_checkpoint.py +4 -14
  376. mindspore/train/callback/_flops_collector.py +11 -7
  377. mindspore/train/callback/_landscape.py +0 -1
  378. mindspore/train/callback/_train_fault_tolerance.py +72 -18
  379. mindspore/train/data_sink.py +15 -6
  380. mindspore/train/dataset_helper.py +14 -5
  381. mindspore/train/model.py +49 -47
  382. mindspore/train/serialization.py +168 -126
  383. mindspore/train/summary/summary_record.py +13 -2
  384. mindspore/train/train_thor/model_thor.py +2 -2
  385. mindspore/turbojpeg.dll +0 -0
  386. mindspore/utils/__init__.py +3 -2
  387. mindspore/utils/dryrun.py +0 -6
  388. mindspore/utils/runtime_execution_order_check.py +162 -78
  389. mindspore/utils/sdc_detect.py +68 -0
  390. mindspore/utils/utils.py +14 -17
  391. mindspore/vcmeta.dll +0 -0
  392. mindspore/vcruntime140.dll +0 -0
  393. mindspore/vcruntime140_1.dll +0 -0
  394. mindspore/version.py +1 -1
  395. {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/METADATA +5 -4
  396. {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/RECORD +400 -439
  397. mindspore/_deprecated/jit.py +0 -198
  398. mindspore/_extends/remote/kernel_build_server_ascend.py +0 -75
  399. mindspore/communication/_hccl_management.py +0 -297
  400. mindspore/experimental/es/embedding_service.py +0 -891
  401. mindspore/experimental/es/embedding_service_layer.py +0 -581
  402. mindspore/profiler/common/validator/__init__.py +0 -14
  403. mindspore/profiler/common/validator/validate_path.py +0 -84
  404. mindspore/profiler/parser/__init__.py +0 -14
  405. mindspore/profiler/parser/aicpu_data_parser.py +0 -272
  406. mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
  407. mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
  408. mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
  409. mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
  410. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
  411. mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
  412. mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
  413. mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
  414. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
  415. mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
  416. mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
  417. mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
  418. mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
  419. mindspore/profiler/parser/ascend_flops_generator.py +0 -116
  420. mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
  421. mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
  422. mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
  423. mindspore/profiler/parser/ascend_memory_generator.py +0 -185
  424. mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
  425. mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
  426. mindspore/profiler/parser/ascend_op_generator.py +0 -334
  427. mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
  428. mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
  429. mindspore/profiler/parser/base_timeline_generator.py +0 -483
  430. mindspore/profiler/parser/container.py +0 -229
  431. mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
  432. mindspore/profiler/parser/flops_parser.py +0 -531
  433. mindspore/profiler/parser/framework_enum.py +0 -111
  434. mindspore/profiler/parser/framework_parser.py +0 -464
  435. mindspore/profiler/parser/framework_struct.py +0 -61
  436. mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
  437. mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
  438. mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
  439. mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
  440. mindspore/profiler/parser/hccl_parser.py +0 -573
  441. mindspore/profiler/parser/hwts_log_parser.py +0 -122
  442. mindspore/profiler/parser/integrator.py +0 -526
  443. mindspore/profiler/parser/memory_usage_parser.py +0 -277
  444. mindspore/profiler/parser/minddata_analyzer.py +0 -800
  445. mindspore/profiler/parser/minddata_parser.py +0 -186
  446. mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
  447. mindspore/profiler/parser/op_intermediate_parser.py +0 -149
  448. mindspore/profiler/parser/optime_parser.py +0 -250
  449. mindspore/profiler/parser/profiler_info.py +0 -213
  450. mindspore/profiler/parser/step_trace_parser.py +0 -666
  451. mindspore/utils/hooks.py +0 -81
  452. /mindspore/common/{_auto_dynamic.py → dynamic_shape/_auto_dynamic.py} +0 -0
  453. {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/WHEEL +0 -0
  454. {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/entry_points.txt +0 -0
  455. {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/top_level.txt +0 -0
@@ -72,7 +72,7 @@ Note:
72
72
  - When `self` and `other` have different shapes,
73
73
  they must be able to broadcast to a common shape.
74
74
  - `self` and `other` can not be bool type at the same time,
75
- [True, Tensor(True, bool\_), Tensor(np.array([True]), bool\_)] are all considered bool type.
75
+ [True, Tensor(True), Tensor(np.array([True]))] are all considered bool type.
76
76
  - `self` and `other` comply with the implicit type conversion rules to make the data types
77
77
  consistent.
78
78
  - The dimension of `self` should be greater than or equal to 1.
@@ -80,7 +80,7 @@ Note:
80
80
  Args:
81
81
  other (Union[Tensor, number.Number, bool]): `other` is a number.Number or a bool or a tensor whose data type is
82
82
  `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ or
83
- `bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
83
+ `bool <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
84
84
 
85
85
  Returns:
86
86
  Tensor with a shape that is the same as the broadcasted shape of `self` and `other`,
@@ -131,7 +131,7 @@ Note:
131
131
  Args:
132
132
  other (Union[Tensor, number.Number, bool]): `other` is a number.Number or a bool or a tensor whose data type is
133
133
  `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ or
134
- `bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
134
+ `bool <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
135
135
 
136
136
  Keyword Args:
137
137
  alpha (number.Number): A scaling factor applied to `other`, default 1.
@@ -319,39 +319,7 @@ Examples:
319
319
  .. method:: Tensor.any(dim=None, keepdim=False) -> Tensor
320
320
  :noindex:
321
321
 
322
- Tests if any element in tensor evaluates to `True` along the given axes.
323
-
324
- Args:
325
- dim (Union[int, tuple(int), list(int), Tensor], optional): The dimensions to reduce. If ``None`` ,
326
- all dimensions are reduced. Default ``None`` .
327
- keepdim (bool, optional): Whether the output tensor has dim retained or not. Default ``False`` .
328
-
329
- Returns:
330
- Tensor
331
-
332
- Supported Platforms:
333
- ``Ascend`` ``GPU`` ``CPU``
334
-
335
- Examples:
336
- >>> import mindspore
337
- >>> x = mindspore.tensor([[True, False], [True, True]])
338
- >>>
339
- >>> # case 1: By default, mindspore.Tensor.any tests along all the axes.
340
- >>> x.any()
341
- Tensor(shape=[], dtype=Bool, value= True)
342
- >>>
343
- >>> # case 2: Reduces a dimension along dim 1, with keepdim False.
344
- >>> x.any(dim=1)
345
- Tensor(shape=[2], dtype=Bool, value= [ True, True])
346
- >>>
347
- >>> # case 3: Reduces a dimension along dim (0, 1), with keepdim False.
348
- >>> x.any(dim=(0,1))
349
- Tensor(shape=[], dtype=Bool, value= True)
350
- >>>
351
- >>> # case 4: Reduces a dimension along dim [0, 1], with keepdim True.
352
- >>> x.any(dim=[0,1], keepdim=True)
353
- Tensor(shape=[1, 1], dtype=Bool, value=
354
- [[ True]])
322
+ For details, please refer to :func:`mindspore.mint.any`.
355
323
  """)
356
324
  attach_docstr("arccosh", r"""arccosh() -> Tensor
357
325
 
@@ -718,7 +686,7 @@ Examples:
718
686
  attach_docstr("ceil", r"""ceil() -> Tensor
719
687
 
720
688
  For details, please refer to :func:`mindspore.ops.ceil`.""")
721
- attach_docstr("chunk", r"""chunk(chunks, dim=0) -> Tuple of Tensors
689
+ attach_docstr("chunk", r"""chunk(chunks, dim=0) -> tuple[Tensor]
722
690
 
723
691
  Cut the self Tensor into `chunks` sub-tensors along the specified dimension.
724
692
 
@@ -756,7 +724,7 @@ Examples:
756
724
  Tensor(shape=[3], dtype=Float32, value= [ 3.00000000e+00, 4.00000000e+00, 5.00000000e+00]),
757
725
  Tensor(shape=[3], dtype=Float32, value= [ 6.00000000e+00, 7.00000000e+00, 8.00000000e+00]))
758
726
 
759
- .. method:: Tensor.chunk(chunks, axis=0) -> Tuple of Tensors
727
+ .. method:: Tensor.chunk(chunks, axis=0) -> tuple[Tensor]
760
728
  :noindex:
761
729
 
762
730
  Cut the self Tensor into `chunks` sub-tensors along the specified axis.
@@ -829,11 +797,17 @@ Copies the elements from `src` into `self` tensor and returns `self`.
829
797
 
830
798
  .. warning::
831
799
  This is an experimental API that is subject to change or deletion.
832
- The `src` tensor must be broadcastable with the `self` tensor. It may be of a different data type.
800
+
801
+ If Copying is performed between Ascend and Ascend, the `src` tensor must be broadcastable with the `self` tensor,
802
+ and they can be of different data types.
803
+ Copying is performed between CPU and Ascend or CPU and CPU are only supported if `self` and `src` have
804
+ the same shape and data type and they are all contiguous.
833
805
 
834
806
  Args:
835
807
  src (Tensor): the source tensor to copy from.
836
- non_blocking (bool, optional): no effect currently. Default: ``False``.
808
+ non_blocking (bool, optional): If ``True`` and copying is performed between CPU and Ascend, and `self` and `src`
809
+ have the same shape and data type and are contiguous. The copy may occur asynchronously with respect to the
810
+ host. For other cases, this argument has no effect. Default: ``False``.
837
811
 
838
812
  Returns:
839
813
  Return self Tensor.
@@ -911,7 +885,7 @@ Args:
911
885
  keep_dims (bool, optional): Whether to maintain dimensions specified by `axis`.
912
886
  If true, keep these reduced dimensions and the length is 1.
913
887
  If false, don't keep these dimensions. Default: ``False`` .
914
- dtype (Union[Number, mindspore.bool\_], optional): The data type of the output tensor.
888
+ dtype (Union[Number, mindspore.bool], optional): The data type of the output tensor.
915
889
  Default: ``None`` .
916
890
 
917
891
  Returns:
@@ -1512,7 +1486,7 @@ where params represents the input `input_params`, and indices represents the ind
1512
1486
  On CPU and GPU, an error is raised if an out of bound indice is found. On Ascend, the results may be
1513
1487
  undefined.
1514
1488
  - The data type of self cannot be
1515
- `bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ on Ascend
1489
+ `bool <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ on Ascend
1516
1490
  platform currently.
1517
1491
 
1518
1492
  Args:
@@ -1933,13 +1907,13 @@ Examples:
1933
1907
  >>> import mindspore
1934
1908
  >>> import numpy as np
1935
1909
  >>> from mindspore import Tensor
1936
- >>> input = Tensor(np.array([True, False, True]), mindspore.bool_)
1937
- >>> other = Tensor(np.array([True, True, False]), mindspore.bool_)
1910
+ >>> input = Tensor(np.array([True, False, True]), mindspore.bool)
1911
+ >>> other = Tensor(np.array([True, True, False]), mindspore.bool)
1938
1912
  >>> output = input.logical_xor(other)
1939
1913
  >>> print(output)
1940
1914
  [ False True True]
1941
- >>> x = Tensor(1, mindspore.bool_)
1942
- >>> other = Tensor(0, mindspore.bool_)
1915
+ >>> x = Tensor(1, mindspore.bool)
1916
+ >>> other = Tensor(0, mindspore.bool)
1943
1917
  >>> output = input.logical_xor(other)
1944
1918
  >>> print(output)
1945
1919
  True
@@ -1973,6 +1947,43 @@ In-place version of :func:`mindspore.Tensor.masked_fill`.
1973
1947
  .. warning::
1974
1948
  This is an experimental API that is subject to change or deletion.
1975
1949
  """)
1950
+ attach_docstr("masked_scatter", r"""masked_scatter(mask, source) -> Tensor
1951
+
1952
+ Returns a Tensor. Updates the value in the "self Tensor" with the `tensor` value according to the mask.
1953
+ The shape of `mask` and the shape of the "self Tensor" must be the same or `mask` is broadcastable.
1954
+
1955
+ .. warning::
1956
+ This is an experimental API that is subject to change or deletion.
1957
+
1958
+ Args:
1959
+ mask (Tensor[bool]): A bool tensor with a shape broadcastable to the "self Tensor".
1960
+ source (Tensor): A tensor with the same data type as the "self Tensor". The number
1961
+ of elements must be greater than or equal to the number of True's in `mask`.
1962
+
1963
+ Returns:
1964
+ Tensor, with the same type and shape as the "self Tensor".
1965
+
1966
+ Raises:
1967
+ TypeError: If `mask` or `source` is not a Tensor.
1968
+ TypeError: If data type of the "self Tensor" is not be supported.
1969
+ TypeError: If dtype of `mask` is not bool.
1970
+ TypeError: If the dim of the "self Tensor" is less than the dim of `mask`.
1971
+ ValueError: If `mask` can not be broadcastable to the "self Tensor".
1972
+ ValueError: If the number of elements in `source` is less than the number of elements to be updated in the tensor.
1973
+
1974
+ Supported Platforms:
1975
+ ``Ascend`` ``CPU``
1976
+
1977
+ Examples:
1978
+ >>> import numpy as np
1979
+ >>> import mindspore
1980
+ >>> from mindspore import Tensor
1981
+ >>> source = Tensor(np.array([1., 2., 3., 4.]), mindspore.float32)
1982
+ >>> mask = Tensor(np.array([True, True, False, True]), mindspore.bool_)
1983
+ >>> tensor = Tensor(np.array([5., 6., 7.]), mindspore.float32)
1984
+ >>> output = source.masked_scatter(mask, tensor)
1985
+ >>> print(output)
1986
+ [5. 6. 3. 7.]""")
1976
1987
  attach_docstr("masked_select", r"""masked_select(mask) -> Tensor
1977
1988
 
1978
1989
  For details, please refer to :func:`mindspore.ops.masked_select`.""")
@@ -2234,7 +2245,7 @@ Examples:
2234
2245
 
2235
2246
  For details, please refer to :func:`mindspore.ops.mean` .
2236
2247
  """)
2237
- attach_docstr("median", r"""median(axis=-1, keepdims=False) -> Tuple of Tensors
2248
+ attach_docstr("median", r"""median(axis=-1, keepdims=False) -> tuple[Tensor]
2238
2249
 
2239
2250
  Computes the median and indices of input tensor.
2240
2251
 
@@ -2283,7 +2294,7 @@ Returns:
2283
2294
  Supported Platforms:
2284
2295
  ``Ascend``
2285
2296
 
2286
- .. method:: Tensor.median(dim=-1, keepdim=False) -> Tuple of Tensors
2297
+ .. method:: Tensor.median(dim=-1, keepdim=False) -> tuple[Tensor]
2287
2298
  :noindex:
2288
2299
 
2289
2300
  Output the median on the specified dimension ``dim`` and its corresponding index.
@@ -2499,7 +2510,7 @@ Note:
2499
2510
  - When `self` and `other` have different shapes,
2500
2511
  `other` be able to broadcast to a `self`.
2501
2512
  - `self` and `other` can not be bool type at the same time,
2502
- [True, Tensor(True, bool\_), Tensor(np.array([True]), bool\_)] are all considered bool type.
2513
+ [True, Tensor(True), Tensor(np.array([True]))] are all considered bool type.
2503
2514
 
2504
2515
  Args:
2505
2516
  other (Union[Tensor, number.Number, bool]): `other` is a number.Number or
@@ -2664,6 +2675,77 @@ attach_docstr("neg", r"""neg() -> Tensor
2664
2675
 
2665
2676
  For details, please refer to :func:`mindspore.ops.neg`.
2666
2677
  """)
2678
+ attach_docstr("new_empty", r"""new_empty(size, *, dtype=None, device=None) -> Tensor
2679
+
2680
+ Returns an uninitialized Tensor. Its shape is specified by `size`, its dtype is specified by `dtype` and its
2681
+ device is specified by `device`.
2682
+
2683
+ .. warning::
2684
+ This is an experimental API that is subject to change or deletion.
2685
+
2686
+ Args:
2687
+ size (Union[tuple[int], list[int], int]): The specified shape of output tensor. Only positive integer or
2688
+ tuple or list containing positive integers are allowed.
2689
+
2690
+ Keyword Args:
2691
+ dtype (:class:`mindspore.dtype`, optional): The specified dtype of the output tensor. If `dtype = None`,
2692
+ the tensor will have the same dtype as `self`. Default ``None``.
2693
+ device (string, optional): The specified device of the output tensor. In PyNative mode, ``"Ascend"``, ``"npu"``,
2694
+ ``"cpu"`` and ``"CPU"`` are supported. In graph mode O0, ``"Ascend"`` and ``"npu"`` are supported. If `device = None`,
2695
+ the value set by :func:`mindspore.set_device` will be used. Default ``None``.
2696
+
2697
+ Returns:
2698
+ Tensor, whose shape, dtype and device are defined by input but with uninitialized data (May be a random value).
2699
+
2700
+ Raises:
2701
+ TypeError: If `size` is neither an int nor a tuple or list of int.
2702
+
2703
+ Supported Platforms:
2704
+ ``Ascend`` ``CPU``
2705
+
2706
+ Examples:
2707
+ >>> import mindspore
2708
+ >>> from mindspore import Tensor
2709
+ >>> x = Tensor([[1, 2, 3], [4, 5, 6]])
2710
+ >>> output1 = x.new_empty((2, 3))
2711
+ >>> print(output1)
2712
+ [[0 0 0]
2713
+ [0 0 0]]
2714
+ >>> output2 = x.new_empty((2, 3), dtype=mindspore.float64)
2715
+ >>> print(output2)
2716
+ [[0. 0. 0.]
2717
+ [0. 0. 0.]]
2718
+ """)
2719
+ attach_docstr("new_full", r"""new_full(size, fill_value, *, dtype=None) -> Tensor
2720
+
2721
+ Return a tensor of `size` filled with `fill_value`.
2722
+
2723
+ Args:
2724
+ size (Union[tuple(int), list(int)]): The output shape.
2725
+ fill_value (Union[Number, bool]): The value to fill the output tensor.
2726
+
2727
+ Keyword Args:
2728
+ dtype (:class:`mindspore.dtype`, optional): The desired data type of returned Tensor. If None, the returned tensor has the same dtype as `self`. Default: ``None``.
2729
+
2730
+ Returns:
2731
+ Tensor, the shape and dtype is defined above and filled with `fill_value`.
2732
+
2733
+ Raises:
2734
+ TypeError: If `size` is not a tuple or list of int.
2735
+ TypeError: If `dtype` is not a MindSpore dtype.
2736
+ ValueError: If `size` contains negative values.
2737
+
2738
+ Supported Platforms:
2739
+ ``Ascend``
2740
+
2741
+ Examples:
2742
+ >>> from mindspore import Tensor
2743
+ >>> x = Tensor([1, 2, 3, 4], mindspore.int32)
2744
+ >>> output = x.new_full((2, 3), 3)
2745
+ >>> print(output)
2746
+ [[3 3 3]
2747
+ [3 3 3]]
2748
+ """)
2667
2749
  attach_docstr("new_ones", r"""new_ones(size, dtype=None) -> Tensor
2668
2750
 
2669
2751
  Return a tensor of `size` filled with ones.
@@ -2874,11 +2956,11 @@ Supports broadcasting to a common shape and implicit type promotion.
2874
2956
 
2875
2957
  The dividend `self` is a tensor whose data type is
2876
2958
  `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ or
2877
- `bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
2959
+ `bool <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
2878
2960
 
2879
2961
  Args:
2880
2962
  other (Union[Tensor, numbers.Number, bool]): The divisor is a numbers.Number or
2881
- a bool or a tensor whose data type is number or bool\_ when the dividend is a tensor.
2963
+ a bool or a tensor whose data type is number or bool when the dividend is a tensor.
2882
2964
 
2883
2965
  Returns:
2884
2966
  Tensor, with dtype promoted and shape broadcasted.
@@ -2946,6 +3028,49 @@ Examples:
2946
3028
  >>> print(output)
2947
3029
  [2. 1. 0.]
2948
3030
  """)
3031
+ attach_docstr("remainder_", r"""remainder_(other) -> Tensor
3032
+
3033
+ Computes the remainder of `self` divided by `other` element-wise. The result has the same sign as the divisor `other`
3034
+ and its absolute value is less than that of `other`.
3035
+
3036
+ .. code-block::
3037
+
3038
+ remainder(self, other) == self - self.div(other, rounding_mode="floor") * other
3039
+
3040
+ .. warning::
3041
+ This is an experimental API that is subject to change or deletion.
3042
+
3043
+ Note:
3044
+ - Complex inputs are not supported.
3045
+ - The dividend `self` is a tensor whose data type is
3046
+ `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
3047
+ - When `self` and `other` have different shapes, `other` should be able to broadcast to a `self`.
3048
+
3049
+ Args:
3050
+ other (Union[Tensor, number, bool]): The divisor is a number or
3051
+ a bool or a tensor whose data type is number or bool.
3052
+
3053
+ Returns:
3054
+ Tensor, the shape and the data type are the same as those of `self` .
3055
+
3056
+ Raises:
3057
+ RuntimeError: If `other` cannot be broadcast to `self`.
3058
+
3059
+ Supported Platforms:
3060
+ ``Ascend``
3061
+
3062
+ Examples:
3063
+ >>> import mindspore
3064
+ >>> from mindspore import Tensor
3065
+ >>> import numpy as np
3066
+ >>> x = Tensor(np.array([2, 4, -1]), mindspore.int32)
3067
+ >>> other = Tensor(np.array([3, -6, -2]), mindspore.int32)
3068
+ >>> output = x.remainder_(other)
3069
+ >>> print(output)
3070
+ [ 2 -2 -1]
3071
+ >>> print(x)
3072
+ [ 2 -2 -1]
3073
+ """)
2949
3074
  attach_docstr("repeat", r"""repeat(*repeats)
2950
3075
 
2951
3076
  Copy the elements in each dimension of a Tensor based on the specified number of repetition times.
@@ -4044,7 +4169,7 @@ Args:
4044
4169
  other (Union[Tensor, number.Number, bool]): The second self, is a number.Number or
4045
4170
  a bool or a tensor whose data type is
4046
4171
  `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_ or
4047
- `bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
4172
+ `bool <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.dtype.html>`_.
4048
4173
 
4049
4174
  Keyword Args:
4050
4175
  alpha (number.Number, optional): A scaling factor applied to `other`, default ``1``.
@@ -1,6 +1,6 @@
1
1
  # This is the Python adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/).
2
2
  #
3
- # Copyright 2022 Huawei Technologies Co., Ltd
3
+ # Copyright 2022-2025 Huawei Technologies Co., Ltd
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
18
18
 
19
19
  import os
20
20
  import math
21
+ import types
21
22
  import ctypes
22
23
  import functools
23
24
 
@@ -46,6 +47,13 @@ def is_dim_unknown(shape):
46
47
  return False
47
48
 
48
49
 
50
+ def get_func(func):
51
+ """Get function object"""
52
+ if isinstance(func, types.MethodType):
53
+ return func.__func__
54
+ return func
55
+
56
+
49
57
  def get_slice_num(dtype, shape):
50
58
  """Check whether size of data is too huge, and cut it to a smaller one, return slice num."""
51
59
  slice_num = 1