mindspore 2.4.10__cp310-cp310-win_amd64.whl → 2.5.0__cp310-cp310-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 (366) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/__init__.py +8 -3
  3. mindspore/_c_dataengine.cp310-win_amd64.pyd +0 -0
  4. mindspore/_c_expression.cp310-win_amd64.pyd +0 -0
  5. mindspore/_c_mindrecord.cp310-win_amd64.pyd +0 -0
  6. mindspore/_checkparam.py +0 -5
  7. mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
  8. mindspore/_extends/parse/compile_config.py +64 -0
  9. mindspore/_extends/parse/deprecated/__init__.py +0 -0
  10. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +375 -0
  11. mindspore/_extends/parse/parser.py +23 -5
  12. mindspore/_extends/parse/standard_method.py +123 -27
  13. mindspore/_extends/pijit/pijit_func_white_list.py +1 -1
  14. mindspore/amp.py +7 -1
  15. mindspore/avcodec-59.dll +0 -0
  16. mindspore/avdevice-59.dll +0 -0
  17. mindspore/avfilter-8.dll +0 -0
  18. mindspore/avformat-59.dll +0 -0
  19. mindspore/avutil-57.dll +0 -0
  20. mindspore/boost/boost_cell_wrapper.py +136 -41
  21. mindspore/common/__init__.py +3 -1
  22. mindspore/common/_register_for_tensor.py +0 -1
  23. mindspore/common/_stub_tensor.py +25 -4
  24. mindspore/common/_tensor_cpp_method.py +17 -0
  25. mindspore/common/_tensor_docs.py +6132 -0
  26. mindspore/common/api.py +98 -21
  27. mindspore/common/dtype.py +34 -34
  28. mindspore/common/dump.py +2 -1
  29. mindspore/common/file_system.py +8 -3
  30. mindspore/common/generator.py +2 -0
  31. mindspore/common/hook_handle.py +3 -1
  32. mindspore/common/initializer.py +3 -4
  33. mindspore/common/lazy_inline.py +8 -2
  34. mindspore/common/mindir_util.py +10 -2
  35. mindspore/common/parameter.py +31 -15
  36. mindspore/common/tensor.py +713 -1337
  37. mindspore/communication/__init__.py +1 -1
  38. mindspore/communication/_comm_helper.py +5 -0
  39. mindspore/communication/comm_func.py +215 -173
  40. mindspore/communication/management.py +23 -20
  41. mindspore/context.py +285 -191
  42. mindspore/dataset/__init__.py +23 -19
  43. mindspore/dataset/callback/ds_callback.py +2 -1
  44. mindspore/dataset/core/config.py +84 -3
  45. mindspore/dataset/engine/cache_admin.py +3 -3
  46. mindspore/dataset/engine/cache_client.py +5 -4
  47. mindspore/dataset/engine/datasets.py +192 -149
  48. mindspore/dataset/engine/datasets_audio.py +14 -0
  49. mindspore/dataset/engine/datasets_standard_format.py +11 -11
  50. mindspore/dataset/engine/datasets_text.py +38 -1
  51. mindspore/dataset/engine/datasets_user_defined.py +100 -66
  52. mindspore/dataset/engine/datasets_vision.py +81 -8
  53. mindspore/dataset/engine/iterators.py +281 -63
  54. mindspore/dataset/engine/obs/util.py +8 -0
  55. mindspore/dataset/engine/queue.py +40 -0
  56. mindspore/dataset/engine/samplers.py +26 -2
  57. mindspore/dataset/engine/serializer_deserializer.py +1 -1
  58. mindspore/dataset/engine/validators.py +43 -11
  59. mindspore/dataset/transforms/py_transforms_util.py +17 -0
  60. mindspore/dataset/transforms/transforms.py +29 -12
  61. mindspore/dataset/vision/validators.py +1 -2
  62. mindspore/device_context/__init__.py +21 -0
  63. mindspore/device_context/ascend/__init__.py +25 -0
  64. mindspore/device_context/ascend/device.py +72 -0
  65. mindspore/device_context/ascend/op_debug.py +94 -0
  66. mindspore/device_context/ascend/op_precision.py +193 -0
  67. mindspore/device_context/ascend/op_tuning.py +127 -0
  68. mindspore/device_context/cpu/__init__.py +25 -0
  69. mindspore/device_context/cpu/device.py +62 -0
  70. mindspore/device_context/cpu/op_tuning.py +43 -0
  71. mindspore/device_context/gpu/__init__.py +21 -0
  72. mindspore/device_context/gpu/device.py +70 -0
  73. mindspore/device_context/gpu/op_precision.py +67 -0
  74. mindspore/device_context/gpu/op_tuning.py +175 -0
  75. mindspore/device_manager.py +134 -0
  76. mindspore/dnnl.dll +0 -0
  77. mindspore/experimental/llm_boost/__init__.py +1 -0
  78. mindspore/experimental/llm_boost/ascend_native/__init__.py +22 -0
  79. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +211 -0
  80. mindspore/experimental/llm_boost/ascend_native/llm_boost.py +52 -0
  81. mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
  82. mindspore/experimental/llm_boost/atb/llama_boost.py +6 -1
  83. mindspore/experimental/llm_boost/register.py +1 -0
  84. mindspore/experimental/optim/adadelta.py +26 -22
  85. mindspore/experimental/optim/adam.py +3 -0
  86. mindspore/experimental/optim/lr_scheduler.py +33 -24
  87. mindspore/experimental/optim/radam.py +33 -30
  88. mindspore/hal/device.py +28 -0
  89. mindspore/hal/event.py +17 -0
  90. mindspore/hal/memory.py +94 -3
  91. mindspore/hal/stream.py +91 -6
  92. mindspore/include/api/context.h +0 -1
  93. mindspore/jpeg62.dll +0 -0
  94. mindspore/log.py +12 -0
  95. mindspore/mindrecord/__init__.py +1 -1
  96. mindspore/mindrecord/config.py +17 -316
  97. mindspore/mindrecord/filereader.py +1 -9
  98. mindspore/mindrecord/filewriter.py +5 -15
  99. mindspore/mindrecord/mindpage.py +1 -9
  100. mindspore/mindspore_backend.dll +0 -0
  101. mindspore/mindspore_common.dll +0 -0
  102. mindspore/mindspore_core.dll +0 -0
  103. mindspore/mindspore_glog.dll +0 -0
  104. mindspore/mindspore_ops.dll +0 -0
  105. mindspore/mint/__init__.py +824 -218
  106. mindspore/mint/distributed/__init__.py +66 -4
  107. mindspore/mint/distributed/distributed.py +2594 -44
  108. mindspore/mint/linalg/__init__.py +6 -0
  109. mindspore/mint/nn/__init__.py +473 -14
  110. mindspore/mint/nn/functional.py +486 -11
  111. mindspore/mint/nn/layer/__init__.py +17 -4
  112. mindspore/mint/nn/layer/_functions.py +330 -0
  113. mindspore/mint/nn/layer/activation.py +169 -1
  114. mindspore/mint/nn/layer/basic.py +123 -0
  115. mindspore/mint/nn/layer/conv.py +727 -0
  116. mindspore/mint/nn/layer/normalization.py +215 -19
  117. mindspore/mint/nn/layer/padding.py +797 -0
  118. mindspore/mint/nn/layer/pooling.py +170 -0
  119. mindspore/mint/optim/__init__.py +2 -1
  120. mindspore/mint/optim/adam.py +223 -0
  121. mindspore/mint/optim/adamw.py +26 -19
  122. mindspore/mint/special/__init__.py +2 -1
  123. mindspore/multiprocessing/__init__.py +5 -0
  124. mindspore/nn/cell.py +126 -19
  125. mindspore/nn/dynamic_lr.py +2 -1
  126. mindspore/nn/layer/activation.py +6 -6
  127. mindspore/nn/layer/basic.py +35 -25
  128. mindspore/nn/layer/channel_shuffle.py +3 -3
  129. mindspore/nn/layer/embedding.py +3 -3
  130. mindspore/nn/layer/normalization.py +8 -7
  131. mindspore/nn/layer/padding.py +4 -3
  132. mindspore/nn/layer/pooling.py +47 -13
  133. mindspore/nn/layer/rnn_cells.py +1 -1
  134. mindspore/nn/layer/rnns.py +2 -1
  135. mindspore/nn/layer/timedistributed.py +5 -5
  136. mindspore/nn/layer/transformer.py +48 -26
  137. mindspore/nn/learning_rate_schedule.py +5 -3
  138. mindspore/nn/loss/loss.py +31 -36
  139. mindspore/nn/optim/ada_grad.py +1 -0
  140. mindspore/nn/optim/adadelta.py +2 -2
  141. mindspore/nn/optim/adam.py +1 -1
  142. mindspore/nn/optim/lars.py +1 -4
  143. mindspore/nn/optim/optimizer.py +1 -1
  144. mindspore/nn/optim/rprop.py +2 -2
  145. mindspore/nn/optim/thor.py +2 -1
  146. mindspore/nn/utils/init.py +13 -11
  147. mindspore/nn/wrap/cell_wrapper.py +4 -6
  148. mindspore/nn/wrap/loss_scale.py +3 -4
  149. mindspore/numpy/array_creations.py +60 -62
  150. mindspore/numpy/array_ops.py +148 -143
  151. mindspore/numpy/logic_ops.py +41 -42
  152. mindspore/numpy/math_ops.py +361 -359
  153. mindspore/numpy/utils.py +16 -16
  154. mindspore/numpy/utils_const.py +4 -4
  155. mindspore/opencv_core452.dll +0 -0
  156. mindspore/opencv_imgcodecs452.dll +0 -0
  157. mindspore/opencv_imgproc452.dll +0 -0
  158. mindspore/ops/__init__.py +2 -1
  159. mindspore/ops/_grad_experimental/grad_comm_ops.py +94 -13
  160. mindspore/ops/_grad_experimental/grad_debug_ops.py +6 -1
  161. mindspore/ops/_grad_experimental/grad_inner_ops.py +9 -0
  162. mindspore/ops/_grad_experimental/grad_math_ops.py +2 -1
  163. mindspore/ops/_op_impl/cpu/__init__.py +1 -0
  164. mindspore/ops/_op_impl/cpu/raise_op.py +28 -0
  165. mindspore/ops/_vmap/vmap_array_ops.py +20 -19
  166. mindspore/ops/_vmap/vmap_base.py +0 -2
  167. mindspore/ops/_vmap/vmap_grad_nn_ops.py +19 -13
  168. mindspore/ops/_vmap/vmap_math_ops.py +11 -9
  169. mindspore/ops/_vmap/vmap_nn_ops.py +20 -34
  170. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +149 -12
  171. mindspore/ops/auto_generate/gen_arg_handler.py +0 -61
  172. mindspore/ops/auto_generate/gen_extend_func.py +554 -60
  173. mindspore/ops/auto_generate/gen_ops_def.py +1621 -115
  174. mindspore/ops/auto_generate/gen_ops_prim.py +8024 -3409
  175. mindspore/ops/auto_generate/pyboost_inner_prim.py +183 -79
  176. mindspore/ops/composite/base.py +1 -1
  177. mindspore/ops/composite/multitype_ops/_compile_utils.py +229 -30
  178. mindspore/ops/composite/multitype_ops/pow_impl.py +0 -29
  179. mindspore/ops/function/__init__.py +12 -0
  180. mindspore/ops/function/array_func.py +561 -159
  181. mindspore/ops/function/clip_func.py +64 -0
  182. mindspore/ops/function/debug_func.py +28 -20
  183. mindspore/ops/function/image_func.py +1 -1
  184. mindspore/ops/function/linalg_func.py +5 -4
  185. mindspore/ops/function/math_func.py +1659 -290
  186. mindspore/ops/function/nn_func.py +988 -317
  187. mindspore/ops/function/parameter_func.py +3 -56
  188. mindspore/ops/function/random_func.py +243 -33
  189. mindspore/ops/function/sparse_unary_func.py +1 -1
  190. mindspore/ops/functional.py +18 -5
  191. mindspore/ops/functional_overload.py +897 -0
  192. mindspore/ops/operations/__init__.py +3 -2
  193. mindspore/ops/operations/_embedding_cache_ops.py +4 -4
  194. mindspore/ops/operations/_grad_ops.py +2 -34
  195. mindspore/ops/operations/_infer_ops.py +2 -1
  196. mindspore/ops/operations/_inner_ops.py +38 -8
  197. mindspore/ops/operations/array_ops.py +45 -303
  198. mindspore/ops/operations/comm_ops.py +19 -16
  199. mindspore/ops/operations/custom_ops.py +11 -55
  200. mindspore/ops/operations/debug_ops.py +42 -47
  201. mindspore/ops/operations/inner_ops.py +6 -4
  202. mindspore/ops/operations/linalg_ops.py +3 -2
  203. mindspore/ops/operations/manually_defined/ops_def.py +185 -104
  204. mindspore/ops/operations/math_ops.py +11 -216
  205. mindspore/ops/operations/nn_ops.py +146 -308
  206. mindspore/ops/primitive.py +23 -21
  207. mindspore/ops/tensor_method.py +1669 -0
  208. mindspore/ops_generate/aclnn_kernel_register_auto_cc_generator.py +110 -0
  209. mindspore/ops_generate/add_tensor_docs_generator.py +54 -0
  210. mindspore/ops_generate/arg_handler.py +0 -61
  211. mindspore/ops_generate/auto_grad_impl_cc_generator.py +135 -0
  212. mindspore/ops_generate/auto_grad_reg_cc_generator.py +93 -0
  213. mindspore/ops_generate/base_generator.py +11 -0
  214. mindspore/ops_generate/cpp_create_prim_instance_helper_generator.py +108 -0
  215. mindspore/ops_generate/functional_map_cpp_generator.py +491 -0
  216. mindspore/ops_generate/functional_overload_py_generator.py +110 -0
  217. mindspore/ops_generate/functions_cc_generator.py +233 -0
  218. mindspore/ops_generate/gen_aclnn_implement.py +110 -114
  219. mindspore/ops_generate/gen_constants.py +157 -3
  220. mindspore/ops_generate/gen_ops.py +245 -990
  221. mindspore/ops_generate/gen_pyboost_func.py +97 -998
  222. mindspore/ops_generate/gen_utils.py +119 -33
  223. mindspore/ops_generate/lite_ops_cpp_generator.py +155 -0
  224. mindspore/ops_generate/op_api_proto.py +206 -0
  225. mindspore/ops_generate/op_def_py_generator.py +131 -0
  226. mindspore/ops_generate/op_prim_py_generator.py +480 -0
  227. mindspore/ops_generate/op_proto.py +373 -108
  228. mindspore/ops_generate/op_template_parser.py +436 -0
  229. mindspore/ops_generate/ops_def_cc_generator.py +288 -0
  230. mindspore/ops_generate/ops_def_h_generator.py +74 -0
  231. mindspore/ops_generate/ops_name_h_generator.py +68 -0
  232. mindspore/ops_generate/ops_primitive_h_generator.py +81 -0
  233. mindspore/ops_generate/pyboost_functions_cpp_generator.py +370 -0
  234. mindspore/ops_generate/pyboost_functions_h_generator.py +68 -0
  235. mindspore/ops_generate/pyboost_functions_py_generator.py +148 -0
  236. mindspore/ops_generate/pyboost_grad_function_cpp_generator.py +154 -0
  237. mindspore/ops_generate/pyboost_inner_prim_generator.py +131 -0
  238. mindspore/ops_generate/pyboost_native_grad_functions_generator.py +268 -0
  239. mindspore/ops_generate/pyboost_op_cpp_code_generator.py +851 -0
  240. mindspore/ops_generate/pyboost_overload_functions_cpp_generator.py +344 -0
  241. mindspore/ops_generate/pyboost_utils.py +92 -33
  242. mindspore/ops_generate/template.py +294 -44
  243. mindspore/ops_generate/tensor_func_reg_cpp_generator.py +422 -0
  244. mindspore/parallel/__init__.py +3 -3
  245. mindspore/parallel/_auto_parallel_context.py +24 -33
  246. mindspore/parallel/_parallel_serialization.py +13 -2
  247. mindspore/parallel/_utils.py +4 -1
  248. mindspore/parallel/algo_parameter_config.py +1 -1
  249. mindspore/parallel/checkpoint_transform.py +44 -0
  250. mindspore/parallel/cluster/process_entity/_api.py +131 -37
  251. mindspore/parallel/cluster/process_entity/_utils.py +41 -6
  252. mindspore/parallel/cluster/run.py +20 -3
  253. mindspore/parallel/parameter_broadcast.py +1 -1
  254. mindspore/parallel/shard.py +3 -0
  255. mindspore/parallel/transform_safetensors.py +119 -253
  256. mindspore/profiler/__init__.py +17 -4
  257. mindspore/profiler/analysis/__init__.py +0 -0
  258. mindspore/profiler/analysis/parser/__init__.py +0 -0
  259. mindspore/profiler/analysis/parser/ascend_cann_parser.py +166 -0
  260. mindspore/profiler/analysis/parser/base_parser.py +158 -0
  261. mindspore/profiler/analysis/parser/framework_cann_relation_parser.py +45 -0
  262. mindspore/profiler/analysis/parser/ms_framework_parser.py +142 -0
  263. mindspore/profiler/analysis/parser/ms_minddata_parser.py +145 -0
  264. mindspore/profiler/analysis/parser/timeline_assembly_factory/__init__.py +0 -0
  265. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +261 -0
  266. mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +40 -0
  267. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +84 -0
  268. mindspore/profiler/analysis/parser/timeline_creator/__init__.py +0 -0
  269. mindspore/profiler/analysis/parser/timeline_creator/base_timeline_creator.py +44 -0
  270. mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +90 -0
  271. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +76 -0
  272. mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +103 -0
  273. mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +134 -0
  274. mindspore/profiler/analysis/parser/timeline_event/__init__.py +0 -0
  275. mindspore/profiler/analysis/parser/timeline_event/base_event.py +233 -0
  276. mindspore/profiler/analysis/parser/timeline_event/cpu_op_event.py +47 -0
  277. mindspore/profiler/analysis/parser/timeline_event/flow_event.py +36 -0
  278. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +260 -0
  279. mindspore/profiler/analysis/parser/timeline_event/msprof_event.py +73 -0
  280. mindspore/profiler/analysis/parser/timeline_event/scope_layer_event.py +53 -0
  281. mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +146 -0
  282. mindspore/profiler/analysis/task_manager.py +131 -0
  283. mindspore/profiler/analysis/time_converter.py +84 -0
  284. mindspore/profiler/analysis/viewer/__init__.py +0 -0
  285. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +333 -0
  286. mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +87 -0
  287. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +252 -0
  288. mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +313 -0
  289. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +322 -0
  290. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +265 -0
  291. mindspore/profiler/analysis/viewer/ascend_timeline_viewer.py +58 -0
  292. mindspore/profiler/analysis/viewer/base_viewer.py +26 -0
  293. mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +97 -0
  294. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +581 -0
  295. mindspore/profiler/analysis/work_flow.py +73 -0
  296. mindspore/profiler/common/ascend_msprof_exporter.py +138 -0
  297. mindspore/profiler/common/command_executor.py +90 -0
  298. mindspore/profiler/common/constant.py +174 -3
  299. mindspore/profiler/common/file_manager.py +208 -0
  300. mindspore/profiler/common/log.py +130 -0
  301. mindspore/profiler/common/msprof_cmd_tool.py +202 -0
  302. mindspore/profiler/common/path_manager.py +371 -0
  303. mindspore/profiler/common/process_bar.py +168 -0
  304. mindspore/profiler/common/process_pool.py +9 -3
  305. mindspore/profiler/common/profiler_context.py +476 -0
  306. mindspore/profiler/common/profiler_info.py +304 -0
  307. mindspore/profiler/common/profiler_output_path.py +284 -0
  308. mindspore/profiler/common/profiler_parameters.py +210 -0
  309. mindspore/profiler/common/profiler_path_manager.py +120 -0
  310. mindspore/profiler/common/record_function.py +76 -0
  311. mindspore/profiler/common/tlv_decoder.py +76 -0
  312. mindspore/profiler/common/util.py +75 -2
  313. mindspore/profiler/dynamic_profiler.py +270 -37
  314. mindspore/profiler/envprofiler.py +138 -0
  315. mindspore/profiler/mstx.py +199 -0
  316. mindspore/profiler/platform/__init__.py +21 -0
  317. mindspore/profiler/platform/base_profiler.py +40 -0
  318. mindspore/profiler/platform/cpu_profiler.py +124 -0
  319. mindspore/profiler/platform/gpu_profiler.py +74 -0
  320. mindspore/profiler/platform/npu_profiler.py +309 -0
  321. mindspore/profiler/profiler.py +580 -93
  322. mindspore/profiler/profiler_action_controller.py +187 -0
  323. mindspore/profiler/profiler_interface.py +114 -0
  324. mindspore/profiler/schedule.py +208 -0
  325. mindspore/rewrite/api/symbol_tree.py +1 -2
  326. mindspore/run_check/_check_version.py +2 -6
  327. mindspore/runtime/__init__.py +37 -0
  328. mindspore/runtime/device.py +27 -0
  329. mindspore/runtime/event.py +209 -0
  330. mindspore/runtime/executor.py +148 -0
  331. mindspore/runtime/memory.py +392 -0
  332. mindspore/runtime/stream.py +460 -0
  333. mindspore/runtime/thread_bind_core.py +401 -0
  334. mindspore/swresample-4.dll +0 -0
  335. mindspore/swscale-6.dll +0 -0
  336. mindspore/tinyxml2.dll +0 -0
  337. mindspore/train/__init__.py +2 -2
  338. mindspore/train/_utils.py +53 -18
  339. mindspore/train/amp.py +8 -4
  340. mindspore/train/callback/_checkpoint.py +32 -18
  341. mindspore/train/callback/_early_stop.py +1 -1
  342. mindspore/train/callback/_flops_collector.py +105 -69
  343. mindspore/train/callback/_history.py +1 -1
  344. mindspore/train/callback/_summary_collector.py +44 -6
  345. mindspore/train/callback/_tft_register.py +31 -10
  346. mindspore/train/dataset_helper.py +11 -11
  347. mindspore/train/metrics/precision.py +4 -5
  348. mindspore/train/mind_ir_pb2.py +167 -46
  349. mindspore/train/model.py +13 -15
  350. mindspore/train/serialization.py +462 -76
  351. mindspore/train/summary/summary_record.py +1 -2
  352. mindspore/train/train_thor/model_thor.py +1 -1
  353. mindspore/turbojpeg.dll +0 -0
  354. mindspore/utils/__init__.py +4 -2
  355. mindspore/utils/dryrun.py +138 -0
  356. mindspore/utils/runtime_execution_order_check.py +550 -0
  357. mindspore/version.py +1 -1
  358. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/METADATA +2 -3
  359. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/RECORD +362 -238
  360. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/entry_points.txt +1 -1
  361. mindspore/common/_tensor_overload.py +0 -139
  362. mindspore/mindspore_np_dtype.dll +0 -0
  363. mindspore/profiler/envprofiling.py +0 -254
  364. mindspore/profiler/profiling.py +0 -1926
  365. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/WHEEL +0 -0
  366. {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1669 @@
1
+ # Copyright 2024 Huawei Technologies Co., Ltd
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ============================================================================
15
+ """Tensor method for overload."""
16
+
17
+ from mindspore import _checkparam as validator
18
+ from mindspore import log as logger
19
+ from mindspore import ops
20
+ from mindspore.ops import operations as P
21
+ from mindspore.ops import functional as F
22
+ from mindspore.ops.composite.multitype_ops import _compile_utils as utils
23
+ from mindspore.ops.composite.multitype_ops._compile_utils import (
24
+ sequence_to_tensor, _tensor_sub, _tensor_pow, _tensor_div
25
+ )
26
+ from mindspore.ops.auto_generate.gen_ops_prim import (
27
+ inplace_scatter_src_op, inplace_scatter_src_reduce_op, inplace_scatter_value_op, inplace_scatter_value_reduce_op
28
+ )
29
+ # 1 common import
30
+
31
+ # 2 common import
32
+ from mindspore import Tensor
33
+ # 3 common import
34
+ from mindspore.common import dtype as mstype
35
+ # 4 common import
36
+ from mindspore.common import COOTensor
37
+ # 5 common import
38
+
39
+ # 6 common import
40
+
41
+ # 7 common import
42
+
43
+
44
+ # 1 to
45
+ from mindspore.ops.auto_generate import cast
46
+ # 2 masked_fill
47
+
48
+ # 3 abs
49
+ from mindspore.ops.auto_generate import abs
50
+ # 4 __abs__
51
+
52
+ # 5 add
53
+ from mindspore.ops.auto_generate import add_ext, add
54
+
55
+ # 6 all
56
+ from mindspore.ops.auto_generate import all
57
+ # 7 allclose
58
+
59
+ # 8 any
60
+ from mindspore.ops.function.math_func import any
61
+ # 9 arctan2
62
+ from mindspore.ops.function.math_func import arctan2
63
+ # 10 argmax
64
+ from mindspore.ops.function.array_func import argmax
65
+ # 11 argmin
66
+ from mindspore.ops.function.math_func import argmin
67
+ # 12 argsort
68
+ from mindspore.ops.function.array_func import argsort
69
+ # 13 atan2
70
+ from mindspore.ops.function.math_func import atan2
71
+ # 14 bfloat16
72
+
73
+ # 15 bmm
74
+
75
+ # 16 bool
76
+
77
+ # 17 broadcast_to
78
+ from mindspore.ops.auto_generate import broadcast_to
79
+ # 18 byte
80
+
81
+ # 19 ceil
82
+ from mindspore.ops.function.math_func import ceil
83
+ # 20 chunk
84
+ from mindspore.ops.function.array_func import chunk
85
+ # 21 clamp
86
+ from mindspore.ops.auto_generate import clamp_tensor, clamp_scalar
87
+ # 22 clip
88
+
89
+ # 23 cos
90
+ from mindspore.ops.function.math_func import cos
91
+ # 24 cumprod
92
+
93
+ # 25 cumsum
94
+ from mindspore.ops.function.math_func import cumsum
95
+ # 26 dim
96
+
97
+ # 27 div
98
+ from mindspore.ops.function.math_func import div
99
+ # 28 divide
100
+
101
+ # 29 eq
102
+ from mindspore.ops.function.math_func import eq
103
+ # 30 erf
104
+ from mindspore.ops.auto_generate import erf
105
+ # 31 exp
106
+ from mindspore.ops.auto_generate import exp
107
+ # 32 expand
108
+
109
+ # 33 expand_as
110
+
111
+ # 34 flatten
112
+ from mindspore.ops.function.array_func import flatten
113
+
114
+ # 35 flip
115
+
116
+ # 36 float
117
+
118
+ # 37 floor
119
+ from mindspore.ops.function.math_func import floor
120
+ # 38 gather
121
+ from mindspore.ops.auto_generate import gather
122
+ from mindspore.ops.function.array_func import gather_ext
123
+ # 39 greater
124
+ from mindspore.ops.function.math_func import greater
125
+ # 40 greater_equal
126
+ from mindspore.ops.function.math_func import greater_equal
127
+ # 41 gt
128
+
129
+ # 42 half
130
+
131
+ # 43 index_put
132
+
133
+ # 44 index_select
134
+ from mindspore.ops.function.array_func import index_select
135
+ # 45 int
136
+
137
+ # 46 inverse
138
+ from mindspore.ops.function.math_func import inverse
139
+ # 47 is_contiguous
140
+
141
+ # 48 isclose
142
+ from mindspore.ops.function.math_func import isclose
143
+ # 49 isfinite
144
+ from mindspore.ops.auto_generate import isfinite
145
+ # 50 isnan
146
+
147
+ # 51 item
148
+
149
+ # 52 le
150
+ from mindspore.ops.function.math_func import le
151
+ # 53 less
152
+
153
+ # 54 less_equal
154
+
155
+ # 55 log
156
+
157
+ # 56 log2
158
+ from mindspore.ops.function.math_func import log2
159
+ # 57 logical_and
160
+ from mindspore.ops.function.math_func import logical_and
161
+ # 58 logical_not
162
+ from mindspore.ops.function.math_func import logical_not
163
+ # 59 logical_or
164
+ from mindspore.ops.function.math_func import logical_or
165
+ # 60 long
166
+
167
+ # 61 lt
168
+
169
+ # 62 masked_fill
170
+ from mindspore.ops.auto_generate import masked_fill
171
+ # 63 masked_select
172
+
173
+ # 64 matmul
174
+ from mindspore.ops.auto_generate import matmul_ext
175
+ # 65 max
176
+ from mindspore.ops.auto_generate import max_
177
+ from mindspore.ops.function.array_func import max as max_func
178
+ # 66 maximum
179
+
180
+ # 67 mean
181
+ from mindspore.ops.auto_generate import mean_ext
182
+ from mindspore.ops.function.math_func import mean
183
+ # 68 min
184
+ from mindspore.ops.auto_generate import min_
185
+ from mindspore.ops.function.array_func import min as min_func
186
+ # 69 minimum
187
+
188
+ # 70 mul
189
+
190
+ # 71 nan_to_num
191
+
192
+ # 72 narrow
193
+
194
+ # 73 ne
195
+
196
+ # 74 neg
197
+
198
+ # 75 negative
199
+
200
+ # 76 nonzero
201
+
202
+ # 77 norm
203
+
204
+ # 78 numel
205
+
206
+ # 79 numpy
207
+
208
+ # 80 outer
209
+
210
+ # 81 permute
211
+
212
+ # 82 pow
213
+ from mindspore.ops.auto_generate import pow
214
+ # 83 prod
215
+ from mindspore.ops.auto_generate import prod_ext
216
+ # 84 reciprocal
217
+ from mindspore.ops.function.math_func import reciprocal
218
+ # 85 remainder
219
+ from mindspore.ops.function.math_func import remainder
220
+ # 86 repeat
221
+
222
+ # 87 repeat_interleave
223
+ from mindspore.ops.function.array_func import repeat_interleave, repeat_interleave_ext
224
+ # 88 reshape
225
+ from mindspore.ops.auto_generate import reshape
226
+ # 89 round
227
+ from mindspore.ops.function.math_func import round
228
+ # 90 rsqrt
229
+ from mindspore.ops.auto_generate import rsqrt
230
+ # 91 scatter
231
+ from mindspore.ops.function.array_func import scatter
232
+ # 92 scatter_add
233
+ from mindspore.ops.function.array_func import tensor_scatter_add
234
+ # 93 select
235
+ from mindspore.ops.auto_generate import select, select_ext
236
+ # 94 sigmoid
237
+ from mindspore.ops.auto_generate import sigmoid
238
+ # 95 sin
239
+ from mindspore.ops.auto_generate import sin
240
+ # 96 size
241
+
242
+ # 97 sort
243
+ from mindspore.ops.function.array_func import sort
244
+ # 98 split
245
+ from mindspore.ops.function.array_func import split
246
+ # 99 sqrt
247
+ from mindspore.ops.auto_generate import sqrt
248
+ # 100 square
249
+ from mindspore.ops.auto_generate import square
250
+ # 101 squeeze
251
+
252
+ # 102 std
253
+
254
+ # 103 sub
255
+ from mindspore.ops.auto_generate import sub, sub_ext
256
+ # 104 sum
257
+ from mindspore.ops.function.math_func import sum
258
+ # 105 swapaxes
259
+
260
+ # 106 t
261
+ from mindspore.ops.function.math_func import t
262
+ # 107 tanh
263
+ from mindspore.ops.auto_generate import tanh
264
+ # 108 tile
265
+ from mindspore.ops.operations.manually_defined import tile
266
+ # 109 tolist
267
+
268
+ # 110 topk
269
+ from mindspore.ops.function.array_func import topk
270
+ # 111 transpose
271
+ from mindspore.ops.auto_generate import transpose, transpose_ext
272
+ # 112 tril
273
+ from mindspore.ops.function.array_func import tril
274
+ # 113 trunc
275
+
276
+ # 114 type
277
+
278
+ # 115 type_as
279
+
280
+ # 116 unbind
281
+
282
+ # 117 unfold
283
+
284
+ # 118 unique
285
+ from mindspore.ops.auto_generate import UniqueDim, Unique2
286
+ # 119 unsqeeze
287
+
288
+ # 120 view
289
+
290
+ # 121 contiguous
291
+
292
+ # 122 where
293
+ from mindspore.ops.function.array_func import where as where_func
294
+
295
+ # 123 div_
296
+
297
+ # 124 fill_
298
+
299
+ # 125 floor_
300
+
301
+ # 126 masked_fill_
302
+
303
+ # 127 mul_
304
+
305
+ # 128 normal_
306
+
307
+ # 129 requires_grad_
308
+
309
+ # 130 sub_
310
+
311
+ # 131 uniform_
312
+
313
+ # 132 absolute
314
+
315
+ # 133 bincount
316
+ from mindspore.ops.function.math_func import bincount
317
+
318
+ # 134 diff
319
+
320
+ # 135 double
321
+
322
+ # 136 lcm
323
+
324
+ # 137 mm
325
+
326
+ # 138 ravel
327
+
328
+ # 139 nelement
329
+
330
+ # 140 stride
331
+
332
+ # 141 indices
333
+
334
+ # 142 view_as
335
+ from mindspore.ops.auto_generate import view_as
336
+ # 143 values
337
+
338
+ # 144 index_copy
339
+
340
+ # 145 element_size
341
+
342
+ # 146 gcd
343
+ from mindspore.ops.auto_generate import gcd
344
+
345
+ # 147 isinf
346
+ from mindspore.ops.auto_generate import isinf
347
+ # 148 not_equal
348
+
349
+ # 149 triu
350
+
351
+ # 150 __eq__
352
+
353
+ # 151 fmod
354
+ from mindspore.ops.function.math_func import fmod
355
+ # 152
356
+
357
+ # 153
358
+ from mindspore.ops.auto_generate import acos_ext, acosh_ext, asin_ext, asinh_ext, atan_ext, dot
359
+ # 154 isneginf
360
+ from mindspore.ops.auto_generate import isneginf_ext
361
+
362
+ # 155
363
+ from mindspore.ops.function.math_func import median
364
+
365
+ # 156
366
+
367
+ # 157
368
+ from mindspore._c_expression import pyboost_empty
369
+
370
+ # 158
371
+
372
+ # 159 histc
373
+ from mindspore.ops.function.math_func import histc
374
+
375
+ # 160 frac
376
+ from mindspore.ops.function.math_func import frac
377
+
378
+ # 161 bitwise_not
379
+ from mindspore.ops.auto_generate.gen_ops_prim import bitwise_not_op
380
+
381
+ # 162 log10
382
+ from mindspore.ops.function.math_func import log10
383
+
384
+ from mindspore.ops.auto_generate import clone
385
+ from mindspore.ops.function.array_func import new_ones
386
+ from mindspore.ops.function.array_func import new_zeros
387
+
388
+ # 163
389
+ from mindspore.ops.auto_generate import cosh
390
+ from mindspore.ops.auto_generate import sinc
391
+ from mindspore.ops.auto_generate import sinh
392
+ from mindspore.ops.function.array_func import unsqueeze
393
+
394
+ # 204 erfc
395
+ from mindspore.ops.auto_generate import erfc
396
+
397
+ # 207 expm1
398
+ from mindspore.ops.auto_generate import expm1
399
+
400
+ # 220 hardshrink
401
+ from mindspore.ops.auto_generate import hardshrink
402
+
403
+ # 931
404
+ from mindspore.ops.function.math_func import nansum
405
+
406
+ # 244 log1p
407
+ from mindspore.ops.auto_generate import log1p
408
+
409
+ # 501
410
+ from mindspore.ops.function.math_func import addbmm
411
+ # 502
412
+ from mindspore.ops.function.math_func import addmm
413
+ # 880
414
+ from mindspore.ops.auto_generate import lerp, lerp_scalar
415
+
416
+ # 790 addmv
417
+ from mindspore.ops.function.math_func import addmv
418
+
419
+ # 1028
420
+ from mindspore.ops.function.math_func import var_ext
421
+
422
+ # 1029 exp_
423
+ from mindspore.ops.auto_generate.gen_ops_prim import inplace_exp_op
424
+
425
+
426
+ ########################################functions########################################
427
+ def place_holder():
428
+ logger.error(
429
+ "This is a place holder function and should not be called. Please check the implementation.")
430
+
431
+
432
+ unique_dim_ = UniqueDim()
433
+ unique2_ = Unique2()
434
+
435
+
436
+ # 1 to
437
+ def tensor_to(input, dtype):
438
+ return cast(input, dtype)
439
+
440
+
441
+ # 2 masked_fill
442
+ def tensor_masked_fill(input_x, mask, value):
443
+ return masked_fill(input_x, mask, value)
444
+
445
+
446
+ # 3 abs
447
+ def tensor_abs(input):
448
+ return abs(input)
449
+
450
+
451
+ # 4 __abs__
452
+
453
+ # 5 add
454
+ def tensor_add_ext(input, other, *, alpha=1):
455
+ return add_ext(input, other, alpha=alpha)
456
+
457
+
458
+ def deprecated_tensor_add(input, other):
459
+ if isinstance(other, COOTensor):
460
+ return other + input
461
+ if isinstance(other, (tuple, list)):
462
+ other = sequence_to_tensor(other, F.dtype(input))
463
+ return add(input, other)
464
+
465
+
466
+ # 6 all
467
+ def tensor_all(x, axis=None, keep_dims=False):
468
+ return all(x, axis, keep_dims)
469
+
470
+
471
+ def deprecated_tensor_all(x, dim=None, keepdim=False):
472
+ return all(x, dim, keepdim)
473
+
474
+
475
+ # 7 allclose
476
+ def tensor_allclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False):
477
+ return isclose(input, other, rtol, atol, equal_nan).all().item()
478
+
479
+
480
+ # 8 any
481
+ def tensor_any(x, axis=None, keep_dims=False):
482
+ if axis is None:
483
+ axis = ()
484
+ return any(x, axis, keep_dims)
485
+
486
+
487
+ def deprecated_tensor_any(x, dim=None, keepdim=False):
488
+ if dim is None:
489
+ dim = ()
490
+ return any(x, dim, keepdim)
491
+
492
+
493
+ # 9 arctan2
494
+ def tensor_arctan2(input, other):
495
+ return arctan2(input, other)
496
+
497
+
498
+ # 10 argmax
499
+ def tensor_argmax(input, dim=None, keepdim=False):
500
+ return argmax(input, dim, keepdim)
501
+
502
+
503
+ def deprecated_tensor_argmax(input, axis=None, keepdims=False):
504
+ return argmax(input, axis, keepdims)
505
+
506
+
507
+ # 11 argmin
508
+ def tensor_argmin(input, dim=None, keepdim=False):
509
+ return argmin(input, dim, keepdim)
510
+
511
+
512
+ def deprecated_tensor_argmin(input, axis=None, keepdims=False):
513
+ return argmin(input, axis, keepdims)
514
+
515
+
516
+ # 12 argsort
517
+ def tensor_argsort(input, dim=-1, descending=False):
518
+ return argsort(input, dim, descending)
519
+
520
+
521
+ def deprecated_tensor_argsort(input, axis=-1, descending=False):
522
+ return argsort(input, axis, descending)
523
+
524
+
525
+ # 13 atan2
526
+ def tensor_atan2(input, other):
527
+ return atan2(input, other)
528
+
529
+
530
+ # 14 bfloat16
531
+
532
+ # 15 bmm
533
+
534
+ # 16 bool
535
+
536
+ # 17 broadcast_to
537
+
538
+ # 18 byte
539
+
540
+ # 19 ceil
541
+ def tensor_ceil(input):
542
+ return ceil(input)
543
+
544
+
545
+ # 20 chunk
546
+ def deprecated_tensor_chunk(input, chunks, axis=0):
547
+ return chunk(input, chunks, axis)
548
+
549
+
550
+ def tensor_chunk(input, chunks, dim=0):
551
+ return chunk(input, chunks, dim)
552
+
553
+
554
+ # 21 clamp
555
+ def tensor_clamp_tensor(input, min=None, max=None):
556
+ return clamp_tensor(input, min, max)
557
+
558
+
559
+ def tensor_clamp_scalar(input, min=None, max=None):
560
+ return clamp_scalar(input, min, max)
561
+
562
+
563
+ # 22 clip
564
+
565
+ # 23 cos
566
+ def tensor_cos(input):
567
+ return cos(input)
568
+
569
+
570
+ # 24 cumprod
571
+
572
+ # 25 cumsum
573
+ def deprecated_tensor_cumsum(x, axis=None, dtype=None):
574
+ r"""
575
+ For details, please refer to :func:`mindspore.ops.cumsum`.
576
+ """
577
+ original_dtype = x.dtype
578
+ # If original tensor is int, and has precision less then int32, convert to int32
579
+ if x.dtype in (mstype.bool_, mstype.int8, mstype.int16, mstype.uint8, mstype.int16):
580
+ x = x.astype(mstype.int32)
581
+ if axis is None:
582
+ x = x.ravel()
583
+ axis = 0
584
+ validator.check_axis_in_range(axis, x.ndim)
585
+ if dtype is not None and original_dtype != dtype:
586
+ return cumsum(x, axis).astype(dtype, copy=False)
587
+ return cumsum(x, axis)
588
+
589
+
590
+ def tensor_cumsum(input, dim, *, dtype=None):
591
+ return deprecated_tensor_cumsum(input, dim, dtype)
592
+
593
+
594
+ # 26 dim
595
+
596
+ # 27 div
597
+ def tensor_div(input, value, *, rounding_mode=None):
598
+ return div(input, value, rounding_mode=rounding_mode)
599
+
600
+
601
+ def tensor_div_deal_sequence(input, other, *, rounding_mode=None):
602
+ if isinstance(input, (tuple, list)):
603
+ input = sequence_to_tensor(input, F.dtype(other))
604
+ if isinstance(other, (tuple, list)):
605
+ other = sequence_to_tensor(other, F.dtype(input))
606
+ return div(input, other, rounding_mode=rounding_mode)
607
+
608
+ # 28 divide
609
+
610
+ # 29 eq
611
+ def tensor_eq(input, other):
612
+ return eq(input, other)
613
+
614
+
615
+ # 30 erf
616
+ def tensor_erf(input):
617
+ return erf(input)
618
+
619
+
620
+ # 31 exp
621
+ def tensor_exp(input):
622
+ return exp(input)
623
+
624
+
625
+ # 32 expand
626
+
627
+ # 33 expand_as
628
+ def tensor_expand_as(input, other):
629
+ return broadcast_to(input, other.shape)
630
+
631
+
632
+ def deprecated_tensor_expand_as(input, x):
633
+ return broadcast_to(input, x.shape)
634
+
635
+
636
+ # 34 flatten
637
+ def deprecated_tensor_flatten(input, order='C', *, start_dim=0, end_dim=-1):
638
+ return flatten(input, order, start_dim=start_dim, end_dim=end_dim)
639
+
640
+
641
+ def tensor_flatten(input, start_dim=0, end_dim=-1):
642
+ return flatten(input, start_dim=start_dim, end_dim=end_dim)
643
+
644
+
645
+ # 35 flip
646
+
647
+ # 36 float
648
+
649
+ # 37 floor
650
+ def tensor_floor(input):
651
+ return floor(input)
652
+
653
+
654
+ # 38 gather
655
+ def tensor_gather_ext(input, dim, index):
656
+ return gather_ext(input, dim, index)
657
+
658
+
659
+ def deprecated_tensor_gather(input, input_indices, axis, batch_dims=0):
660
+ r"""
661
+ For details, please refer to :func:`mindspore.ops.gather`.
662
+ """
663
+ validator.check_is_int(axis, 'axis')
664
+ validator.check_is_int(batch_dims, "batch_dims")
665
+ return gather(input, input_indices, axis, batch_dims)
666
+
667
+
668
+ # 39 greater
669
+ def tensor_greater(input, other):
670
+ return greater(input, other)
671
+
672
+
673
+ # 40 greater_equal
674
+ def tensor_greater_equal(input, other):
675
+ return greater_equal(input, other)
676
+
677
+
678
+ # 41 gt
679
+
680
+ # 42 half
681
+
682
+ # 43 index_put
683
+
684
+ # 44 index_select
685
+ def tensor_index_select(input, dim, index):
686
+ return index_select(input, dim, index)
687
+
688
+
689
+ def deprecated_tensor_index_select(input, axis, index):
690
+ return index_select(input, axis, index)
691
+
692
+
693
+ # 45 int
694
+
695
+ # 46 inverse
696
+ def tensor_inverse(input):
697
+ return inverse(input)
698
+
699
+
700
+ def deprecated_tensor_inverse(input):
701
+ return inverse(input)
702
+
703
+
704
+ # 47 is_contiguous
705
+
706
+ # 48 isclose
707
+ def deprecated_tensor_isclose(input, x2, rtol=1e-05, atol=1e-08, equal_nan=False):
708
+ return isclose(input, x2, rtol, atol, equal_nan)
709
+
710
+
711
+ # 49 isfinite
712
+ def tensor_isfinite(input):
713
+ return isfinite(input)
714
+
715
+
716
+ # 50 isnan
717
+
718
+ # 51 item
719
+
720
+ # 52 le
721
+ def tensor_le(input, other):
722
+ return le(input, other)
723
+
724
+
725
+ # 53 less
726
+ def tensor_less(input, other):
727
+ return F.less(input, other)
728
+
729
+
730
+ # 54 less_equal
731
+
732
+ # 55 log
733
+ def tensor_log(input):
734
+ return F.log(input)
735
+
736
+
737
+ # 56 log2
738
+ def tensor_log2(input):
739
+ return log2(input)
740
+
741
+
742
+ # 57 logical_and
743
+ def tensor_logical_and(input, other):
744
+ return logical_and(input, other)
745
+
746
+
747
+ # 58 logical_not
748
+ def tensor_logical_not(input):
749
+ return logical_not(input)
750
+
751
+
752
+ # 59 logical_or
753
+ def tensor_logical_or(input, other):
754
+ return logical_or(input, other)
755
+
756
+
757
+ # 60 long
758
+
759
+ # 61 lt
760
+
761
+ # 62 masked_fill
762
+
763
+ # 63 masked_select
764
+ def tensor_masked_select(tensor, mask):
765
+ return F.masked_select(tensor, mask)
766
+
767
+
768
+ # 64 matmul
769
+ def tensor_matmul(input, mat2):
770
+ return matmul_ext(input, mat2)
771
+
772
+
773
+ def deprecated_tensor_matmul(input, tensor2):
774
+ return F.matmul(input, tensor2)
775
+
776
+
777
+ # 65 max
778
+ def tensor_max(input):
779
+ return max_(input)
780
+
781
+
782
+ def tensor_maxdim(input, dim, keepdim=False):
783
+ argmax_with_value_op = P.ArgMaxWithValue(dim, keepdim)
784
+ indices, values = argmax_with_value_op(input)
785
+ return values, indices
786
+
787
+
788
+ def deprecated_tensor_max(input, axis=None, keepdims=False, *, initial=None, where=True, return_indices=False):
789
+ r"""
790
+ For details, please refer to :func:`mindspore.ops.max`.
791
+ """
792
+ if isinstance(axis, (list, tuple)):
793
+ reduce_max = P.ReduceMax
794
+ maximum = F.maximum
795
+ return utils.reduce_(input, reduce_max(keepdims), cmp_fn=maximum, axis=axis, keepdims=keepdims,
796
+ initial=initial, where=where)
797
+ values, indices = max_func(input, axis, keepdims, initial=initial, where=where)
798
+ if not return_indices:
799
+ return values
800
+ return values, indices
801
+
802
+
803
+ # 66 maximum
804
+ def tensor_maximum(input, other):
805
+ return F.maximum(input, other)
806
+
807
+
808
+ # 67 mean
809
+ def tensor_mean_ext(input, axis=None, keep_dims=False, *, dtype=None):
810
+ return mean_ext(input, axis, keep_dims, dtype=dtype)
811
+
812
+
813
+ def deprecated_tensor_mean(input, axis=None, keep_dims=False):
814
+ return mean(input, axis, keep_dims)
815
+
816
+
817
+ # 68 min
818
+ def tensor_min(input):
819
+ return min_(input)
820
+
821
+
822
+ def tensor_mindim(input, dim, keepdim=False):
823
+ argmin_with_value_op = P.ArgMinWithValue(dim, keepdim)
824
+ indices, values = argmin_with_value_op(input)
825
+ return values, indices
826
+
827
+
828
+ def deprecated_tensor_min(input, axis=None, keepdims=False, *, initial=None, where=True, return_indices=False):
829
+ r"""
830
+ For details, please refer to :func:`mindspore.ops.min`.
831
+ """
832
+ if isinstance(axis, (list, tuple)):
833
+ reduce_min = P.ReduceMin
834
+ minimum = F.minimum
835
+ return utils.reduce_(input, reduce_min(keepdims), cmp_fn=minimum, axis=axis, keepdims=keepdims,
836
+ initial=initial, where=where)
837
+ values, indices = min_func(input, axis, keepdims, initial=initial, where=where)
838
+ if not return_indices:
839
+ return values
840
+ return values, indices
841
+
842
+
843
+ # 69 minimum
844
+ def tensor_minimum(input, other):
845
+ return F.minimum(input, other)
846
+
847
+
848
+ # 70 mul
849
+ def tensor_mul(input, other):
850
+ return F.mul(input, other)
851
+
852
+
853
+ # 71 nan_to_num
854
+ def tensor_nan_to_num(input, nan=0.0, posinf=None, neginf=None):
855
+ return F.nan_to_num(input, nan, posinf, neginf)
856
+
857
+
858
+ # 72 narrow
859
+ def deprecated_tensor_narrow(input, axis, start, length):
860
+ return F.narrow(input, axis, start, length)
861
+
862
+
863
+ # 73 ne
864
+ def tensor_ne(input, other):
865
+ return F.ne(input, other)
866
+
867
+
868
+ # 74 neg
869
+ def tensor_neg(input):
870
+ return F.neg(input)
871
+
872
+
873
+ # 75 negative
874
+
875
+ # 76 nonzero
876
+
877
+ # 77 norm
878
+
879
+ # 78 numel
880
+
881
+ # 79 numpy
882
+
883
+ # 80 outer
884
+ def deprecated_tensor_outer(input, vec2):
885
+ return F.outer(input, vec2)
886
+
887
+
888
+ # 81 permute
889
+
890
+ # 82 pow
891
+ def tensor_pow_tensor_tensor(input, exponent):
892
+ return pow(input, exponent)
893
+
894
+
895
+ def deprecated_tensor_pow(input, exponent):
896
+ return pow(input, exponent)
897
+
898
+
899
+ # 83 prod
900
+ def tensor_prod(input, axis=None, keep_dims=False, dtype=None):
901
+ return prod_ext(input, axis, keep_dims, dtype)
902
+
903
+
904
+ def deprecated_tensor_prod(input, dim=None, keepdim=False, dtype=None):
905
+ return prod_ext(input, dim, keepdim, dtype)
906
+
907
+
908
+ # 84 reciprocal
909
+ def tensor_reciprocal(input):
910
+ return reciprocal(input)
911
+
912
+
913
+ # 85 remainder
914
+ def tensor_remainder(input, other):
915
+ return remainder(input, other)
916
+
917
+
918
+ def deprecated_tensor_remainder(input, divisor):
919
+ return remainder(input, divisor)
920
+
921
+
922
+ # 86 repeat
923
+
924
+ # 87 repeat_interleave
925
+ def deprecated_tensor_repeat_interleave(input, repeats, dim=None):
926
+ return repeat_interleave(input, repeats, dim)
927
+
928
+
929
+ def tensor_repeat_interleave_ext(input, repeats, dim=None, *, output_size=None):
930
+ return repeat_interleave_ext(input, repeats, dim, output_size)
931
+
932
+
933
+ # 88 reshape
934
+ def tensor_reshape(input, *shape):
935
+ new_shape = validator.check_reshape_shp(shape)
936
+ return reshape(input, new_shape)
937
+
938
+
939
+ # 89 round
940
+ def tensor_round(input, decimals=0):
941
+ return round(input, decimals=decimals)
942
+
943
+
944
+ # 90 rsqrt
945
+ def tensor_rsqrt(input):
946
+ return rsqrt(input)
947
+
948
+
949
+ # 91 scatter
950
+ def tensor_scatter(input, dim, index, src):
951
+ return scatter(input, dim, index, src)
952
+
953
+
954
+ def deprecated_tensor_scatter(input, axis, index, src):
955
+ return scatter(input, axis, index, src)
956
+
957
+
958
+ # 92 scatter_add
959
+ def tensor_scatter_add_empty(input, dim, index, src):
960
+ raise ValueError("should not come here for scatter_add method.")
961
+
962
+
963
+ def deprecated_tensor_scatter_add(input, indices, updates):
964
+ return tensor_scatter_add(input, indices, updates)
965
+
966
+
967
+ # 93 select
968
+ def tensor_select_ext(input, dim, index):
969
+ return select_ext(input, dim, index)
970
+
971
+
972
+ def deprecated_tensor_select(input, condition, y):
973
+ r"""
974
+ For details, please refer to :func:`mindspore.ops.select`.
975
+ """
976
+ if not isinstance(condition, Tensor):
977
+ raise TypeError(f"For 'Tensor.select', the argument 'condition' should be Tensor,"
978
+ f" but got {type(condition)}.")
979
+ if not isinstance(y, (Tensor, int, float)):
980
+ raise TypeError(f"For 'Tensor.select', the argument 'y' should be Tensor, int or float,"
981
+ f" but got {type(y)}.")
982
+ if isinstance(y, int) and input.dtype != mstype.int32:
983
+ raise TypeError(f"For 'Tensor.select', if the argument 'y' is int,"
984
+ f" then the tensor type should be int32 but got {input.dtype}")
985
+ if isinstance(y, float) and input.dtype != mstype.float32:
986
+ raise TypeError(f"For 'Tensor.select', if the argument 'y' is float,"
987
+ f" then the tensor type should be float32 but got {input.dtype}")
988
+ input_y = y
989
+ if isinstance(y, (int, float)):
990
+ zeros_like = F.zeros_like
991
+ cast_f = F.cast
992
+ input_y = zeros_like(input) + y
993
+ if isinstance(y, int):
994
+ input_y = cast_f(input_y, mstype.int32)
995
+ else:
996
+ input_y = cast_f(input_y, mstype.float32)
997
+ return select(condition, input, input_y)
998
+
999
+
1000
+ # 94 sigmoid
1001
+ def tensor_sigmoid(input):
1002
+ return sigmoid(input)
1003
+
1004
+
1005
+ # 95 sin
1006
+ def tensor_sin(input):
1007
+ return sin(input)
1008
+
1009
+
1010
+ # 96 size
1011
+
1012
+ # 97 sort
1013
+ def deprecated_tensor_sort(input, axis=-1, descending=False):
1014
+ return sort(input, axis, descending)
1015
+
1016
+
1017
+ def tensor_sort(input, dim=-1, descending=False, stable=False):
1018
+ return sort(input, dim, descending)
1019
+
1020
+
1021
+ # 98 split
1022
+ def deprecated_tensor_split(input, split_size_or_sections, axis=0):
1023
+ return split(input, split_size_or_sections, axis)
1024
+
1025
+
1026
+ def tensor_split_tensor(input, split_size, dim=0):
1027
+ return deprecated_tensor_split(input, split_size, dim)
1028
+
1029
+
1030
+ def tensor_split_with_size(input, split_size, dim=0):
1031
+ return deprecated_tensor_split(input, split_size, dim)
1032
+
1033
+
1034
+ # 99 sqrt
1035
+ def tensor_sqrt(x):
1036
+ return sqrt(x)
1037
+
1038
+
1039
+ # 100 square
1040
+ def tensor_square(input):
1041
+ return square(input)
1042
+
1043
+
1044
+ # 101 squeeze
1045
+
1046
+ # 102 std
1047
+ def tensor_std(input, dim=None, *, correction=0, keepdim=False):
1048
+ x_var = input.var(dim, correction, keepdim)
1049
+ return F.tensor_pow(x_var, 0.5)
1050
+
1051
+
1052
+ def deprecated_tensor_std(self, axis=None, ddof=0, keepdims=False):
1053
+ """
1054
+ For details, please refer to :func:`mindspore.ops.std`.
1055
+ """
1056
+ x_var = self.var(axis, ddof, keepdims)
1057
+ return F.tensor_pow(x_var, 0.5)
1058
+
1059
+
1060
+ # 103 sub
1061
+ def tensor_sub_ext(input, other, *, alpha=1):
1062
+ return sub_ext(input, other, alpha=alpha)
1063
+
1064
+
1065
+ def deprecated_tensor_sub(input, y):
1066
+ if isinstance(y, COOTensor):
1067
+ return F.tensor_scatter_sub(input, y.indices, y.values)
1068
+ if isinstance(input, (tuple, list)):
1069
+ input = sequence_to_tensor(input, F.dtype(y))
1070
+ if isinstance(y, (tuple, list)):
1071
+ y = sequence_to_tensor(y, F.dtype(input))
1072
+ return sub(input, y)
1073
+
1074
+
1075
+ def deprecated_tensor_sub_(input, y):
1076
+ if isinstance(y, COOTensor):
1077
+ return F.tensor_scatter_sub(input, y.indices, y.values)
1078
+ if isinstance(input, (tuple, list)):
1079
+ input = sequence_to_tensor(input, F.dtype(y))
1080
+ if isinstance(y, (tuple, list)):
1081
+ y = sequence_to_tensor(y, F.dtype(input))
1082
+ return sub(input, y)
1083
+
1084
+
1085
+ # 104 sum
1086
+ def tensor_sum_ext(input, dim=None, keepdim=False, *, dtype=None):
1087
+ return sum(input, dim, keepdim, dtype=dtype)
1088
+
1089
+
1090
+ def deprecated_tensor_sum(input, axis=None, dtype=None, keepdims=False, initial=None):
1091
+ if initial is None:
1092
+ res = sum(input, axis, keepdims, dtype=dtype)
1093
+ else:
1094
+ res = sum(input, axis, keepdims, dtype=dtype) + initial
1095
+ if dtype is not None and (dtype == mstype.bool_):
1096
+ res = res.astype(mstype.bool_)
1097
+ return res
1098
+
1099
+
1100
+ # 105 swapaxes
1101
+
1102
+ # 106 t
1103
+ def tensor_t(input):
1104
+ return t(input)
1105
+
1106
+
1107
+ def deprecated_tensor_t(input):
1108
+ r"""
1109
+ For details, please refer to :func:`mindspore.ops.t`.
1110
+ """
1111
+ return t(input)
1112
+
1113
+
1114
+ # 107 tanh
1115
+ def tensor_tanh(input):
1116
+ return tanh(input)
1117
+
1118
+
1119
+ # 108 tile
1120
+ def tensor_tile(input, dims):
1121
+ return tile(input, dims)
1122
+
1123
+
1124
+ def deprecated_tensor_tile(input, reps):
1125
+ return tile(input, reps)
1126
+
1127
+
1128
+ # 109 tolist
1129
+
1130
+ # 110 topk
1131
+ def tensor_topk(input, k, dim=-1, largest=True, sorted=True):
1132
+ return topk(input, k, dim, largest, sorted)
1133
+
1134
+
1135
+ def deprecated_tensor_topk(input, k, dim=None, largest=True, sorted=True):
1136
+ return topk(input, k, dim, largest, sorted)
1137
+
1138
+
1139
+ # 111 transpose
1140
+ def tensor_transpose_ext(input, dim0, dim1):
1141
+ return transpose_ext(input, dim0, dim1)
1142
+
1143
+
1144
+ def deprecated_tensor_transpose(input, *axes):
1145
+ perm = validator.check_transpose_axis(axes, input.ndim)
1146
+ return transpose(input, perm)
1147
+
1148
+
1149
+ # 112 tril
1150
+ def deprecated_tensor_tril(input, diagonal=0):
1151
+ return tril(input, diagonal)
1152
+
1153
+
1154
+ # 113 trunc
1155
+ def tensor_trunc(input):
1156
+ return F.trunc(input)
1157
+
1158
+
1159
+ # 114 type
1160
+
1161
+ # 115 type_as
1162
+ def deprecated_tensor_type_as(input, other):
1163
+ return input.astype(other.dtype)
1164
+
1165
+
1166
+ # 116 unbind
1167
+ def deprecated_tensor_unbind(input, dim=0):
1168
+ r"""
1169
+ For details, please refer to :func:`mindspore.ops.unbind`.
1170
+ """
1171
+ return F.unstack(input, dim)
1172
+
1173
+
1174
+ # 117 unfold
1175
+
1176
+ # 118 unique
1177
+ def deprecated_tensor_unique(input, sorted=True, return_inverse=False, return_counts=False, dim=None):
1178
+ """
1179
+ Function for computing the unique elements of a tensor along a specified dimension or over the entire tensor.
1180
+
1181
+ Args:
1182
+ input (Tensor): The input tensor from which to find unique elements.
1183
+ sorted (bool, optional): If True, the unique elements will be sorted. Default is True.
1184
+ return_inverse (bool, optional): Return the indices of the unique elements of the input tensor if true.
1185
+ return_counts (bool, optional): Return the count of each unique element of the input tensor if true.
1186
+ dim (int, optional): The dimension along which to find the unique elements.
1187
+
1188
+ Returns:
1189
+ Tensor or tuple:
1190
+ - If `return_inverse` is False and `return_counts` is False, returns a tensor of unique elements.
1191
+ - If `return_inverse` is True, returns a tuple (unique_elements, inverse_indices).
1192
+ - If `return_counts` is True, returns a tuple (unique_elements, counts).
1193
+ - If both `return_inverse` and `return_counts` are True,
1194
+ returns a tuple (unique_elements, inverse_indices, counts).
1195
+
1196
+ Raises:
1197
+ ValueError: If `return_inverse` or `return_counts` are mutable (non-constant).
1198
+ TypeError: If the `return_counts` argument is not a boolean when `dim` is specified.
1199
+ """
1200
+ if not F.isconstant(return_inverse) or not F.isconstant(return_counts):
1201
+ raise ValueError(
1202
+ f"For 'unique_ext', 'return_inverse' and 'return_counts' cannot be mutable")
1203
+ if dim is None:
1204
+ y, inverse_, counts = unique2_(
1205
+ input, sorted, return_inverse, return_counts)
1206
+ else:
1207
+ validator.check_value_type(
1208
+ "return_counts", return_counts, [bool], "unique_ext")
1209
+ y, inverse_, counts = unique_dim_(input, sorted, return_inverse, dim)
1210
+ if return_inverse and return_counts:
1211
+ return y, inverse_, counts
1212
+ if return_inverse:
1213
+ return y, inverse_
1214
+ if return_counts:
1215
+ return y, counts
1216
+ return y
1217
+
1218
+
1219
+ # 119 unsqeeze
1220
+
1221
+ # 120 view
1222
+
1223
+ # 121 contiguous
1224
+
1225
+ # 122 where
1226
+ def tensor_where(condition, input, other):
1227
+ return where_func(condition, input, other)
1228
+
1229
+
1230
+ def deprecated_tensor_where(input, condition, y):
1231
+ return where_func(condition, input, y)
1232
+
1233
+
1234
+ # 123 div_
1235
+
1236
+ # 124 fill_
1237
+ def tensor_inplace_fill_scalar_empty(input, value):
1238
+ raise ValueError("should not come here for fill_scalar method.")
1239
+
1240
+
1241
+ def tensor_inplace_fill_tensor_empty(input, value):
1242
+ raise ValueError("should not come here for fill_tensor method.")
1243
+
1244
+
1245
+ # 125 floor_
1246
+
1247
+ # 126 masked_fill_
1248
+ def tensor_inplace_masked_fill_scalar_empty(input, masked, value):
1249
+ raise ValueError("should not come here for masked_fill_scalar method.")
1250
+
1251
+
1252
+ def tensor_inplace_masked_fill_tensor_empty(input, masked, value):
1253
+ raise ValueError("should not come here for masked_fill_tensor method.")
1254
+
1255
+
1256
+ # 127 mul_
1257
+ def tensor_inplace_mul(input, other):
1258
+ return F.mul(input, other)
1259
+
1260
+ # 128 normal_
1261
+
1262
+ # 129 requires_grad_
1263
+
1264
+ # 130 sub_
1265
+
1266
+ # 131 uniform_
1267
+
1268
+ # 132 absolute
1269
+
1270
+ # 133 bincount
1271
+ def tensor_bincount(input, weights=None, minlength=0):
1272
+ return bincount(input, weights, minlength)
1273
+
1274
+
1275
+ # 134 diff
1276
+
1277
+ # 135 double
1278
+
1279
+ # 136 lcm
1280
+
1281
+ # 137 mm
1282
+ def tensor_mm(input, mat2):
1283
+ return F.mm(input, mat2)
1284
+
1285
+
1286
+ def deprecated_tensor_mm(input, mat2):
1287
+ return F.mm(input, mat2)
1288
+
1289
+
1290
+ # 138 ravel
1291
+
1292
+ # 139 nelement
1293
+
1294
+ # 140 stride
1295
+
1296
+ # 141 indices
1297
+
1298
+ # 142 view_as
1299
+ def tensor_view_as(input, other):
1300
+ shape = other.shape
1301
+ return reshape(input, shape)
1302
+
1303
+
1304
+ def deprecated_tensor_view_as(input, other):
1305
+ return view_as(input, other)
1306
+
1307
+
1308
+ # 143 values
1309
+
1310
+ # 144 index_copy
1311
+
1312
+ # 145 element_size
1313
+
1314
+ # 146 gcd
1315
+ def tensor_gcd(input, other):
1316
+ return gcd(input, other)
1317
+
1318
+
1319
+ # 147 isinf
1320
+ def tensor_isinf():
1321
+ return isinf()
1322
+
1323
+
1324
+ # 148 not_equal
1325
+ def tensor_not_equal(input, other):
1326
+ return F.ne(input, other)
1327
+
1328
+
1329
+ # 149 triu
1330
+ def tensor_triu(input, diagonal=0):
1331
+ return F.triu(input, diagonal)
1332
+
1333
+
1334
+ # 150 __eq__
1335
+
1336
+ # 151 scatter_
1337
+
1338
+ def tensor_inplace_scatter_src(input, dim, index, src):
1339
+ return inplace_scatter_src_op(input, dim, index, src)
1340
+
1341
+
1342
+ def tensor_inplace_scatter_src_reduce(input, dim, index, src, *, reduce):
1343
+ return inplace_scatter_src_reduce_op(input, dim, index, src, reduce=reduce)
1344
+
1345
+
1346
+ def tensor_inplace_scatter_value(input, dim, index, value):
1347
+ return inplace_scatter_value_op(input, dim, index, value)
1348
+
1349
+
1350
+ def tensor_inplace_scatter_value_reduce(input, dim, index, value, *, reduce):
1351
+ return inplace_scatter_value_reduce_op(input, dim, index, value, reduce=reduce)
1352
+
1353
+
1354
+ # 152 fmod
1355
+ def fmod_tensor(input, other):
1356
+ return fmod(input, other)
1357
+
1358
+
1359
+ def fmod_scalar(input, other):
1360
+ return fmod(input, other)
1361
+
1362
+
1363
+ def deprecated_tensor_fmod(input, other):
1364
+ return fmod(input, other)
1365
+
1366
+
1367
+ # 153 acos, arccos; acosh, arccosh; asin, arcsin; asinh, arcsinh; atan, arctanh, dot
1368
+ def tensor_acos(input):
1369
+ return acos_ext(input)
1370
+
1371
+
1372
+ def deprecated_tensor_acos(input):
1373
+ return F.acos(input)
1374
+
1375
+
1376
+ def tensor_acosh(input):
1377
+ return acosh_ext(input)
1378
+
1379
+
1380
+ def deprecated_tensor_acosh(input):
1381
+ return F.acosh(input)
1382
+
1383
+
1384
+ def tensor_asin(input):
1385
+ return asin_ext(input)
1386
+
1387
+
1388
+ def deprecated_tensor_asin(input):
1389
+ return F.asin(input)
1390
+
1391
+
1392
+ def tensor_asinh(input):
1393
+ return asinh_ext(input)
1394
+
1395
+
1396
+ def deprecated_tensor_asinh(input):
1397
+ return F.asinh(input)
1398
+
1399
+
1400
+ def tensor_atan(input):
1401
+ return atan_ext(input)
1402
+
1403
+
1404
+ def deprecated_tensor_atan(input):
1405
+ return F.atan(input)
1406
+
1407
+
1408
+ def tensor_atanh(input):
1409
+ return F.atanh(input)
1410
+
1411
+
1412
+ def tensor_tan(input):
1413
+ return F.tan(input)
1414
+
1415
+
1416
+ def tensor_dot(input, other):
1417
+ return dot(input, other)
1418
+
1419
+
1420
+ def deprecated_tensor_dot(input, other):
1421
+ return F.dot(input, other)
1422
+
1423
+
1424
+ # 154
1425
+ def tensor_isneginf(input):
1426
+ return isneginf_ext(input)
1427
+
1428
+
1429
+ # 155
1430
+ def deprecated_tensor_median(input, axis=-1, keepdims=False):
1431
+ return median(input, axis, keepdims)
1432
+
1433
+
1434
+ def tensor_median(input):
1435
+ return median(input)
1436
+
1437
+
1438
+ def tensor_median_dim(input, dim=-1, keepdim=False):
1439
+ return median(input, dim, keepdim)
1440
+
1441
+
1442
+ # 156
1443
+
1444
+ # 157
1445
+ def tensor_empty(*size, dtype=None, device=None):
1446
+ return pyboost_empty(size, dtype, device)
1447
+
1448
+
1449
+ # 158
1450
+
1451
+ # 159 histc
1452
+ def tensor_histc(input, bins=100, min=0, max=0):
1453
+ return histc(input, bins, min, max)
1454
+
1455
+
1456
+ # 160 frac
1457
+ def tensor_frac(input):
1458
+ return frac(input)
1459
+
1460
+
1461
+ # 161 bitwise_not
1462
+ def tensor_bitwise_not(input):
1463
+ return bitwise_not_op(input)
1464
+
1465
+
1466
+ # 162
1467
+ def tensor_log10(input):
1468
+ return log10(input)
1469
+
1470
+
1471
+ # 501
1472
+ def tensor_addbmm(input, batch1, batch2, *, beta=1, alpha=1):
1473
+ return addbmm(input, batch1, batch2, beta=beta, alpha=alpha)
1474
+
1475
+
1476
+ def deprecated_tensor_addbmm(input, batch1, batch2, *, beta=1, alpha=1):
1477
+ r"""
1478
+ For details, please refer to :func:`mindspore.ops.addbmm`.
1479
+ """
1480
+ return addbmm(input, batch1, batch2, beta=beta, alpha=alpha)
1481
+
1482
+
1483
+ # 502
1484
+ def tensor_addmm(input, mat1, mat2, *, beta=1, alpha=1):
1485
+ return addmm(input, mat1, mat2, beta=beta, alpha=alpha)
1486
+
1487
+
1488
+ def deprecated_tensor_addmm(input, mat1, mat2, *, beta=1, alpha=1):
1489
+ r"""
1490
+ For details, please refer to :func:`mindspore.ops.addmm`.
1491
+ """
1492
+ return addmm(input, mat1, mat2, beta=beta, alpha=alpha)
1493
+
1494
+
1495
+ # 790
1496
+ def tensor_addmv(input, mat, vec, *, beta=1, alpha=1):
1497
+ return addmv(input, mat, vec, beta=beta, alpha=alpha)
1498
+
1499
+
1500
+ def deprecated_tensor_addmv(input, mat, vec, *, beta=1, alpha=1):
1501
+ r"""
1502
+ For details, please refer to :func:`mindspore.ops.addmv`.
1503
+ """
1504
+ return addmv(input, mat, vec, beta=beta, alpha=alpha)
1505
+
1506
+
1507
+ def tensor_clone(input):
1508
+ return clone(input)
1509
+
1510
+
1511
+ def tensor_new_ones(input, size, dtype=None):
1512
+ return new_ones(input, size, dtype=dtype)
1513
+
1514
+
1515
+ def tensor_new_zeros(input, size, dtype=None):
1516
+ return new_zeros(input, size, dtype=dtype)
1517
+
1518
+
1519
+ def tensor_cosh(input):
1520
+ return cosh(input)
1521
+
1522
+
1523
+ def tensor_sinh(input):
1524
+ return sinh(input)
1525
+
1526
+
1527
+ def tensor_sinc(input):
1528
+ return sinc(input)
1529
+
1530
+
1531
+ def tensor_unsqueeze(input, dim):
1532
+ return
1533
+
1534
+
1535
+ def deprecated_tensor_unsqueeze(input, dim):
1536
+ return unsqueeze(input, dim)
1537
+
1538
+
1539
+ # 204 erfc
1540
+ def tensor_erfc(input):
1541
+ return erfc(input)
1542
+
1543
+
1544
+ # 207 expm1
1545
+ def tensor_expm1(input):
1546
+ return expm1(input)
1547
+
1548
+
1549
+ # 880
1550
+ def tensor_lerp(input, end, weight):
1551
+ return lerp(input, end, weight)
1552
+
1553
+
1554
+ def tensor_lerp_scalar(input, end, weight):
1555
+ return lerp_scalar(input, end, weight)
1556
+
1557
+
1558
+ # 220 hardshrink
1559
+ def tensor_hardshrink(input, lambd=0.5):
1560
+ return hardshrink(input, lambd)
1561
+
1562
+
1563
+ # 931
1564
+ def deprecated_tensor_nansum(input, axis=(), keepdims=False, *, dtype=None):
1565
+ return nansum(input, axis, keepdims, dtype=dtype)
1566
+
1567
+
1568
+ # 244 log1p
1569
+ def tensor_log1p(input):
1570
+ return log1p(input)
1571
+
1572
+
1573
+ # 1028
1574
+ def tensor_var(input, dim=None, *, correction=1, keepdim=False):
1575
+ return var_ext(input, dim, correction=correction, keepdim=keepdim)
1576
+
1577
+
1578
+ def deprecated_tensor_var(input, axis=None, ddof=0, keepdims=False):
1579
+ r"""
1580
+ For details, please refer to :func:`mindspore.ops.var`.
1581
+ """
1582
+ if 0 in input.shape:
1583
+ return Tensor(float('nan'), input.dtype)
1584
+ if not isinstance(ddof, int):
1585
+ raise TypeError("For 'Tensor.var', the type of the argument 'ddof' must be int, but got "
1586
+ "{}.".format(type(ddof)))
1587
+ if not isinstance(keepdims, bool):
1588
+ raise TypeError("For 'Tensor.var', the type of the argument 'keepdims' must be bool, but "
1589
+ "got {}.".format(type(keepdims)))
1590
+
1591
+ if axis is None:
1592
+ axis = ()
1593
+ else:
1594
+ axis = validator.check_and_canonicalize_axes(axis, input.ndim)
1595
+ x_mean = mean(input, axis, True)
1596
+ x_sub = _tensor_sub(input, x_mean)
1597
+ x_pow = _tensor_pow(x_sub, 2)
1598
+ x_sum = P.ReduceSum(bool(keepdims))(x_pow, axis)
1599
+ nums = 1
1600
+ if axis == ():
1601
+ nums = input.size
1602
+ else:
1603
+ for ax in axis:
1604
+ nums *= input.shape[ax]
1605
+ return _tensor_div(x_sum, nums - ddof)
1606
+
1607
+
1608
+ def tensor_sub_empty_(input, other, alpha=1):
1609
+ raise ValueError("should not come here for sub_ method.")
1610
+
1611
+
1612
+ def tensor_inplace_sub(input, other, *, alpha=1):
1613
+ if alpha == 1:
1614
+ return sub(input, other)
1615
+ return sub_ext(input, other, alpha=alpha)
1616
+
1617
+
1618
+ def tensor_div_empty_(input, other, rounding_mode=None):
1619
+ raise ValueError("should not come here for div_ method.")
1620
+
1621
+
1622
+ def tensor_subtract(input, other, *, alpha=1):
1623
+ return tensor_sub_ext(input, other, alpha=alpha)
1624
+
1625
+
1626
+ def tensor_true_divide(input, other):
1627
+ return div(input, other)
1628
+
1629
+
1630
+ def all_gather_matmul(
1631
+ input,
1632
+ x2,
1633
+ group,
1634
+ world_size,
1635
+ *,
1636
+ bias=None,
1637
+ gather_index=0,
1638
+ gather_output=True,
1639
+ comm_turn=0,
1640
+ trans_input=False,
1641
+ trans_x2=False,
1642
+ ):
1643
+ """
1644
+ For details, please refer to :func:`mindspore.ops.all_gather_matmul`.
1645
+ """
1646
+ raise NotImplementedError('all_gather_matmul only supports Ascend.')
1647
+
1648
+
1649
+ def matmul_reduce_scatter(
1650
+ input,
1651
+ x2,
1652
+ group,
1653
+ world_size,
1654
+ *,
1655
+ reduce_op=ops.ReduceOp.SUM,
1656
+ bias=None,
1657
+ comm_turn=0,
1658
+ trans_input=False,
1659
+ trans_x2=False,
1660
+ ):
1661
+ """
1662
+ For details, please refer to :func:`mindspore.ops.matmul_reduce_scatter`.
1663
+ """
1664
+ raise NotImplementedError('matmul_reduce_scatter only supports Ascend.')
1665
+
1666
+
1667
+ # 1029
1668
+ def tensor_exp_(input):
1669
+ return inplace_exp_op(input)