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.
- mindspore/.commit_id +1 -1
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/__init__.py +2 -2
- mindspore/_c_dataengine.cp311-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp311-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp311-win_amd64.pyd +0 -0
- mindspore/_checkparam.py +42 -11
- mindspore/_extends/builtin_operations.py +3 -3
- mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
- mindspore/_extends/optimize/cell_utils.py +96 -0
- mindspore/_extends/parallel_compile/akg_compiler/custom.py +1109 -0
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
- mindspore/_extends/parse/__init__.py +3 -3
- mindspore/_extends/parse/compile_config.py +44 -22
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -2
- mindspore/_extends/parse/parser.py +64 -83
- mindspore/_extends/parse/resources.py +39 -0
- mindspore/_extends/parse/standard_method.py +47 -14
- mindspore/_extends/parse/trope.py +8 -1
- mindspore/_extends/pijit/__init__.py +1 -2
- mindspore/_extends/pijit/pijit_func_white_list.py +2 -5
- mindspore/amp.py +4 -22
- mindspore/atlprov.dll +0 -0
- mindspore/avcodec-59.dll +0 -0
- mindspore/avdevice-59.dll +0 -0
- mindspore/avfilter-8.dll +0 -0
- mindspore/avformat-59.dll +0 -0
- mindspore/avutil-57.dll +0 -0
- mindspore/boost/adasum.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +4 -4
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +43 -12
- mindspore/common/_grad_function.py +2 -1
- mindspore/common/_pijit_context.py +28 -7
- mindspore/common/_stub_tensor.py +1 -209
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +177 -52
- mindspore/common/_utils.py +9 -1
- mindspore/common/api.py +338 -208
- mindspore/common/dtype.py +108 -57
- mindspore/common/dump.py +11 -16
- mindspore/common/dynamic_shape/__init__.py +0 -0
- mindspore/common/{auto_dynamic_shape.py → dynamic_shape/auto_dynamic_shape.py} +17 -23
- mindspore/common/dynamic_shape/enable_dynamic.py +197 -0
- mindspore/common/file_system.py +59 -9
- mindspore/common/generator.py +2 -3
- mindspore/common/hook_handle.py +33 -5
- mindspore/common/jit_config.py +1 -1
- mindspore/common/jit_trace.py +84 -105
- mindspore/common/np_dtype.py +3 -3
- mindspore/common/parameter.py +27 -29
- mindspore/common/recompute.py +5 -7
- mindspore/common/sparse_tensor.py +0 -3
- mindspore/common/symbol.py +0 -1
- mindspore/common/tensor.py +84 -133
- mindspore/communication/_comm_helper.py +46 -4
- mindspore/communication/management.py +79 -7
- mindspore/context.py +47 -38
- mindspore/dataset/__init__.py +1 -1
- mindspore/dataset/audio/transforms.py +1 -1
- mindspore/dataset/core/config.py +38 -4
- mindspore/dataset/engine/datasets.py +350 -322
- mindspore/dataset/engine/datasets_user_defined.py +69 -23
- mindspore/dataset/engine/iterators.py +2 -2
- mindspore/dataset/engine/obs/config_loader.py +2 -2
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
- mindspore/dataset/transforms/c_transforms.py +2 -2
- mindspore/dataset/transforms/py_transforms.py +7 -3
- mindspore/dataset/transforms/transforms.py +10 -6
- mindspore/dataset/vision/__init__.py +1 -1
- mindspore/dataset/vision/py_transforms.py +8 -8
- mindspore/dataset/vision/transforms.py +17 -5
- mindspore/dataset/vision/utils.py +632 -21
- mindspore/dataset/vision/validators.py +1 -0
- mindspore/device_context/ascend/device.py +1 -1
- mindspore/device_context/ascend/op_tuning.py +35 -1
- mindspore/device_context/gpu/__init__.py +2 -2
- mindspore/device_context/gpu/device.py +1 -1
- mindspore/device_context/gpu/op_precision.py +4 -2
- mindspore/device_context/gpu/op_tuning.py +6 -3
- mindspore/device_manager.py +16 -9
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +5 -4
- mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
- mindspore/experimental/optim/adadelta.py +13 -20
- mindspore/experimental/optim/adagrad.py +15 -22
- mindspore/experimental/optim/adam.py +17 -24
- mindspore/experimental/optim/adamax.py +14 -22
- mindspore/experimental/optim/adamw.py +28 -34
- mindspore/experimental/optim/asgd.py +15 -25
- mindspore/experimental/optim/lr_scheduler.py +27 -45
- mindspore/experimental/optim/nadam.py +14 -24
- mindspore/experimental/optim/optimizer.py +13 -23
- mindspore/experimental/optim/radam.py +18 -24
- mindspore/experimental/optim/rmsprop.py +14 -25
- mindspore/experimental/optim/rprop.py +15 -26
- mindspore/experimental/optim/sgd.py +9 -19
- mindspore/hal/__init__.py +4 -4
- mindspore/hal/contiguous_tensors_handle.py +2 -2
- mindspore/hal/memory.py +1 -0
- mindspore/include/api/cell.h +65 -5
- mindspore/include/api/cfg.h +24 -7
- mindspore/include/api/context.h +1 -0
- mindspore/include/api/delegate.h +10 -2
- mindspore/include/api/dual_abi_helper.h +100 -19
- mindspore/include/api/graph.h +14 -1
- mindspore/include/api/kernel.h +16 -3
- mindspore/include/api/kernel_api.h +9 -1
- mindspore/include/api/metrics/accuracy.h +9 -0
- mindspore/include/api/model.h +8 -1
- mindspore/include/api/model_group.h +4 -0
- mindspore/include/api/model_parallel_runner.h +2 -0
- mindspore/include/api/status.h +48 -10
- mindspore/include/api/types.h +8 -3
- mindspore/include/c_api/model_c.h +0 -58
- mindspore/include/c_api/tensor_c.h +0 -26
- mindspore/include/dataset/constants.h +9 -0
- mindspore/include/dataset/vision_ascend.h +1 -1
- mindspore/jpeg62.dll +0 -0
- mindspore/mindrecord/tools/cifar10.py +61 -11
- mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
- mindspore/mindspore_backend_common.dll +0 -0
- mindspore/mindspore_backend_manager.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_cpu_res_manager.dll +0 -0
- mindspore/mindspore_dump.dll +0 -0
- mindspore/mindspore_frontend.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_memory_pool.dll +0 -0
- mindspore/mindspore_ms_backend.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/mindspore_ops_host.dll +0 -0
- mindspore/mindspore_ops_kernel_common.dll +0 -0
- mindspore/mindspore_profiler.dll +0 -0
- mindspore/mindspore_pyboost.dll +0 -0
- mindspore/mindspore_pynative.dll +0 -0
- mindspore/mindspore_res_manager.dll +0 -0
- mindspore/mindspore_runtime_pipeline.dll +0 -0
- mindspore/mint/__init__.py +4 -44
- mindspore/mint/distributed/__init__.py +5 -0
- mindspore/mint/distributed/distributed.py +425 -19
- mindspore/mint/nn/__init__.py +1 -1
- mindspore/mint/nn/functional.py +53 -6
- mindspore/mint/nn/layer/_functions.py +163 -294
- mindspore/mint/nn/layer/activation.py +8 -6
- mindspore/mint/nn/layer/conv.py +125 -101
- mindspore/mint/nn/layer/normalization.py +11 -25
- mindspore/mint/optim/adam.py +19 -18
- mindspore/mint/optim/adamw.py +14 -8
- mindspore/mint/optim/sgd.py +5 -5
- mindspore/msobj140.dll +0 -0
- mindspore/mspdb140.dll +0 -0
- mindspore/mspdbcore.dll +0 -0
- mindspore/mspdbst.dll +0 -0
- mindspore/mspft140.dll +0 -0
- mindspore/msvcdis140.dll +0 -0
- mindspore/msvcp140_1.dll +0 -0
- mindspore/msvcp140_2.dll +0 -0
- mindspore/msvcp140_atomic_wait.dll +0 -0
- mindspore/msvcp140_codecvt_ids.dll +0 -0
- mindspore/nn/cell.py +488 -620
- mindspore/nn/grad/cell_grad.py +11 -12
- mindspore/nn/layer/activation.py +36 -36
- mindspore/nn/layer/basic.py +74 -77
- mindspore/nn/layer/channel_shuffle.py +4 -4
- mindspore/nn/layer/combined.py +4 -2
- mindspore/nn/layer/conv.py +86 -85
- mindspore/nn/layer/dense.py +9 -7
- mindspore/nn/layer/embedding.py +50 -52
- mindspore/nn/layer/image.py +38 -40
- mindspore/nn/layer/math.py +111 -112
- mindspore/nn/layer/normalization.py +56 -44
- mindspore/nn/layer/pooling.py +58 -63
- mindspore/nn/layer/rnn_cells.py +33 -33
- mindspore/nn/layer/rnns.py +56 -56
- mindspore/nn/layer/thor_layer.py +74 -73
- mindspore/nn/layer/transformer.py +11 -1
- mindspore/nn/learning_rate_schedule.py +20 -20
- mindspore/nn/loss/loss.py +79 -81
- mindspore/nn/optim/adam.py +2 -4
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/lamb.py +1 -3
- mindspore/nn/optim/optimizer.py +1 -1
- mindspore/nn/optim/tft_wrapper.py +2 -3
- mindspore/nn/optim/thor.py +2 -2
- mindspore/nn/probability/distribution/_utils/utils.py +2 -2
- mindspore/nn/probability/distribution/exponential.py +2 -1
- mindspore/nn/probability/distribution/poisson.py +2 -1
- mindspore/nn/sparse/sparse.py +3 -3
- mindspore/nn/wrap/cell_wrapper.py +73 -42
- mindspore/nn/wrap/grad_reducer.py +37 -52
- mindspore/nn/wrap/loss_scale.py +72 -74
- mindspore/numpy/array_creations.py +7 -7
- mindspore/numpy/fft.py +1 -1
- mindspore/numpy/math_ops.py +1 -1
- mindspore/numpy/utils_const.py +1 -1
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
- mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
- mindspore/ops/_grad_experimental/grad_inner_ops.py +0 -9
- mindspore/ops/_op_impl/cpu/__init__.py +1 -0
- mindspore/{experimental/es/__init__.py → ops/_op_impl/cpu/joinedstr_op.py} +12 -6
- mindspore/ops/_vmap/vmap_array_ops.py +6 -13
- mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +29 -10
- mindspore/ops/auto_generate/gen_extend_func.py +5 -55
- mindspore/ops/auto_generate/gen_ops_def.py +753 -273
- mindspore/ops/auto_generate/gen_ops_prim.py +1687 -958
- mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
- mindspore/ops/composite/__init__.py +10 -0
- mindspore/ops/composite/base.py +9 -5
- mindspore/ops/composite/multitype_ops/__init__.py +12 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +132 -108
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
- mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
- mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
- mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
- mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
- mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
- mindspore/ops/function/__init__.py +4 -1
- mindspore/ops/function/_add_attr_func.py +11 -6
- mindspore/ops/function/array_func.py +17 -100
- mindspore/ops/function/debug_func.py +8 -5
- mindspore/ops/function/grad/grad_func.py +5 -13
- mindspore/ops/function/math_func.py +65 -399
- mindspore/ops/function/nn_func.py +44 -61
- mindspore/ops/function/other_func.py +4 -1
- mindspore/ops/function/random_func.py +31 -4
- mindspore/ops/functional.py +2 -3
- mindspore/ops/functional_overload.py +486 -18
- mindspore/ops/op_info_register.py +21 -0
- mindspore/ops/operations/__init__.py +5 -2
- mindspore/ops/operations/_custom_ops_utils.py +675 -8
- mindspore/ops/operations/_inner_ops.py +14 -18
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/array_ops.py +4 -50
- mindspore/ops/operations/comm_ops.py +186 -41
- mindspore/ops/operations/custom_ops.py +244 -175
- mindspore/ops/operations/debug_ops.py +55 -4
- mindspore/ops/operations/image_ops.py +13 -13
- mindspore/ops/operations/manually_defined/ops_def.py +27 -28
- mindspore/ops/operations/math_ops.py +8 -9
- mindspore/ops/operations/nn_ops.py +6 -7
- mindspore/ops/primitive.py +9 -20
- mindspore/ops/tensor_method.py +52 -11
- mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
- mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
- mindspore/ops_generate/api/functions_cc_generator.py +58 -10
- mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
- mindspore/ops_generate/common/base_generator.py +14 -0
- mindspore/ops_generate/common/gen_constants.py +7 -2
- mindspore/ops_generate/common/gen_utils.py +0 -19
- mindspore/ops_generate/common/op_proto.py +11 -4
- mindspore/ops_generate/common/template.py +88 -11
- mindspore/ops_generate/gen_ops.py +1 -1
- mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
- mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
- mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
- mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
- mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
- mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
- mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -16
- mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
- mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
- mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
- mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
- mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
- mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
- mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
- mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
- mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
- mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
- mindspore/parallel/_auto_parallel_context.py +9 -17
- mindspore/parallel/_cell_wrapper.py +106 -40
- mindspore/parallel/_parallel_serialization.py +4 -3
- mindspore/parallel/_ps_context.py +4 -6
- mindspore/parallel/_tensor.py +167 -12
- mindspore/parallel/_transformer/moe.py +1 -1
- mindspore/parallel/_transformer/transformer.py +17 -12
- mindspore/parallel/_utils.py +5 -11
- mindspore/parallel/auto_parallel.py +33 -12
- mindspore/parallel/checkpoint_convert.py +3 -3
- mindspore/parallel/checkpoint_transform.py +5 -1
- mindspore/parallel/cluster/process_entity/_api.py +88 -49
- mindspore/parallel/cluster/process_entity/_utils.py +95 -7
- mindspore/parallel/cluster/run.py +48 -7
- mindspore/parallel/function/__init__.py +8 -1
- mindspore/parallel/function/reshard_func.py +7 -6
- mindspore/parallel/nn/__init__.py +15 -2
- mindspore/parallel/nn/parallel_cell_wrapper.py +50 -14
- mindspore/parallel/nn/parallel_grad_reducer.py +7 -14
- mindspore/parallel/shard.py +9 -23
- mindspore/parallel/transform_safetensors.py +468 -174
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +2 -1
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
- mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +3 -0
- mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
- mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
- mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
- mindspore/profiler/analysis/task_manager.py +1 -1
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
- mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +10 -9
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +43 -23
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
- mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
- mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
- mindspore/profiler/common/constant.py +16 -0
- mindspore/profiler/common/msprof_cmd_tool.py +2 -2
- mindspore/profiler/common/path_manager.py +9 -0
- mindspore/profiler/common/profiler_context.py +50 -29
- mindspore/profiler/common/profiler_info.py +0 -16
- mindspore/profiler/common/profiler_meta_data.py +1 -0
- mindspore/profiler/common/profiler_op_analyse.py +239 -0
- mindspore/profiler/common/profiler_output_path.py +23 -8
- mindspore/profiler/common/profiler_parameters.py +128 -35
- mindspore/profiler/dynamic_profile/__init__.py +0 -0
- mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
- mindspore/profiler/dynamic_profiler.py +374 -338
- mindspore/profiler/envprofiler.py +42 -12
- mindspore/profiler/experimental_config.py +112 -7
- mindspore/profiler/mstx.py +33 -12
- mindspore/profiler/platform/__init__.py +2 -3
- mindspore/profiler/platform/cpu_profiler.py +10 -4
- mindspore/profiler/platform/npu_profiler.py +30 -20
- mindspore/profiler/profiler.py +218 -154
- mindspore/profiler/profiler_action_controller.py +65 -77
- mindspore/profiler/profiler_interface.py +2 -2
- mindspore/profiler/schedule.py +10 -4
- mindspore/rewrite/common/config.py +1 -0
- mindspore/rewrite/common/namer.py +1 -0
- mindspore/rewrite/common/namespace.py +1 -0
- mindspore/rewrite/node/node.py +31 -11
- mindspore/rewrite/parsers/assign_parser.py +1 -1
- mindspore/rewrite/symbol_tree/symbol_tree.py +2 -2
- mindspore/run_check/_check_version.py +7 -10
- mindspore/runtime/__init__.py +8 -6
- mindspore/runtime/event.py +10 -4
- mindspore/runtime/executor.py +87 -45
- mindspore/runtime/memory.py +22 -30
- mindspore/runtime/thread_bind_core.py +299 -165
- mindspore/safeguard/rewrite_obfuscation.py +12 -13
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/_utils.py +9 -5
- mindspore/train/amp.py +43 -23
- mindspore/train/callback/__init__.py +5 -5
- mindspore/train/callback/_callback.py +2 -1
- mindspore/train/callback/_checkpoint.py +4 -14
- mindspore/train/callback/_flops_collector.py +11 -7
- mindspore/train/callback/_landscape.py +0 -1
- mindspore/train/callback/_train_fault_tolerance.py +72 -18
- mindspore/train/data_sink.py +15 -6
- mindspore/train/dataset_helper.py +14 -5
- mindspore/train/model.py +49 -47
- mindspore/train/serialization.py +168 -126
- mindspore/train/summary/summary_record.py +13 -2
- mindspore/train/train_thor/model_thor.py +2 -2
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +3 -2
- mindspore/utils/dryrun.py +0 -6
- mindspore/utils/runtime_execution_order_check.py +162 -78
- mindspore/utils/sdc_detect.py +68 -0
- mindspore/utils/utils.py +14 -17
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/METADATA +5 -4
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/RECORD +400 -439
- mindspore/_deprecated/jit.py +0 -198
- mindspore/_extends/remote/kernel_build_server_ascend.py +0 -75
- mindspore/communication/_hccl_management.py +0 -297
- mindspore/experimental/es/embedding_service.py +0 -891
- mindspore/experimental/es/embedding_service_layer.py +0 -581
- mindspore/profiler/common/validator/__init__.py +0 -14
- mindspore/profiler/common/validator/validate_path.py +0 -84
- mindspore/profiler/parser/__init__.py +0 -14
- mindspore/profiler/parser/aicpu_data_parser.py +0 -272
- mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
- mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
- mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
- mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
- mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
- mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
- mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
- mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
- mindspore/profiler/parser/ascend_flops_generator.py +0 -116
- mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
- mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
- mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
- mindspore/profiler/parser/ascend_memory_generator.py +0 -185
- mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
- mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
- mindspore/profiler/parser/ascend_op_generator.py +0 -334
- mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
- mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
- mindspore/profiler/parser/base_timeline_generator.py +0 -483
- mindspore/profiler/parser/container.py +0 -229
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
- mindspore/profiler/parser/flops_parser.py +0 -531
- mindspore/profiler/parser/framework_enum.py +0 -111
- mindspore/profiler/parser/framework_parser.py +0 -464
- mindspore/profiler/parser/framework_struct.py +0 -61
- mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
- mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
- mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
- mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
- mindspore/profiler/parser/hccl_parser.py +0 -573
- mindspore/profiler/parser/hwts_log_parser.py +0 -122
- mindspore/profiler/parser/integrator.py +0 -526
- mindspore/profiler/parser/memory_usage_parser.py +0 -277
- mindspore/profiler/parser/minddata_analyzer.py +0 -800
- mindspore/profiler/parser/minddata_parser.py +0 -186
- mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
- mindspore/profiler/parser/op_intermediate_parser.py +0 -149
- mindspore/profiler/parser/optime_parser.py +0 -250
- mindspore/profiler/parser/profiler_info.py +0 -213
- mindspore/profiler/parser/step_trace_parser.py +0 -666
- mindspore/utils/hooks.py +0 -81
- /mindspore/common/{_auto_dynamic.py → dynamic_shape/_auto_dynamic.py} +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/WHEEL +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/entry_points.txt +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/top_level.txt +0 -0
mindspore/common/_tensor_docs.py
CHANGED
|
@@ -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
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
|
|
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) ->
|
|
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) ->
|
|
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
|
-
|
|
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):
|
|
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
|
|
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
|
-
`
|
|
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.
|
|
1937
|
-
>>> other = Tensor(np.array([True, True, False]), mindspore.
|
|
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.
|
|
1942
|
-
>>> other = Tensor(0, mindspore.
|
|
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) ->
|
|
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) ->
|
|
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
|
|
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
|
-
`
|
|
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
|
|
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
|
-
`
|
|
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``.
|
mindspore/common/_utils.py
CHANGED
|
@@ -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
|