mindspore 2.3.0__cp39-none-any.whl → 2.3.0rc2__cp39-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/Third_Party_Open_Source_Software_Notice +0 -1512
- mindspore/__init__.py +1 -2
- mindspore/_c_dataengine.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_c_expression.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_c_mindrecord.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_checkparam.py +25 -5
- mindspore/_extends/graph_kernel/model/graph_parallel.py +1 -1
- mindspore/_extends/parse/__init__.py +2 -2
- mindspore/_extends/parse/compile_config.py +0 -29
- mindspore/_extends/parse/namespace.py +2 -2
- mindspore/_extends/parse/parser.py +5 -21
- mindspore/_extends/parse/resources.py +7 -5
- mindspore/_extends/parse/standard_method.py +59 -40
- mindspore/_mindspore_offline_debug.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/amp.py +5 -26
- mindspore/bin/cache_admin +0 -0
- mindspore/bin/cache_server +0 -0
- mindspore/boost/adasum.py +1 -1
- mindspore/boost/base.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +1 -1
- mindspore/boost/grad_freeze.py +2 -2
- mindspore/boost/less_batch_normalization.py +6 -9
- mindspore/common/__init__.py +1 -8
- mindspore/common/_register_for_tensor.py +9 -8
- mindspore/common/api.py +65 -275
- mindspore/common/dtype.py +4 -8
- mindspore/common/dump.py +5 -2
- mindspore/common/jit_config.py +1 -1
- mindspore/common/lazy_inline.py +2 -14
- mindspore/common/parameter.py +15 -14
- mindspore/common/recompute.py +5 -20
- mindspore/common/sparse_tensor.py +6 -21
- mindspore/common/tensor.py +52 -100
- mindspore/communication/__init__.py +11 -6
- mindspore/communication/management.py +94 -92
- mindspore/context.py +18 -180
- mindspore/dataset/engine/datasets.py +46 -69
- mindspore/dataset/engine/datasets_user_defined.py +53 -72
- mindspore/dataset/engine/datasets_vision.py +2 -2
- mindspore/dataset/engine/queue.py +38 -56
- mindspore/dataset/engine/validators.py +5 -11
- mindspore/dataset/vision/__init__.py +5 -5
- mindspore/dataset/vision/c_transforms.py +5 -5
- mindspore/dataset/vision/py_transforms_util.py +1 -1
- mindspore/dataset/vision/transforms.py +46 -591
- mindspore/dataset/vision/utils.py +1 -121
- mindspore/dataset/vision/validators.py +3 -9
- mindspore/hal/__init__.py +1 -7
- mindspore/hal/device.py +1 -1
- mindspore/include/api/model.h +0 -3
- mindspore/include/dataset/vision.h +2 -54
- mindspore/include/mindapi/base/types.h +0 -1
- mindspore/lib/libdnnl.so.2 +0 -0
- mindspore/lib/libmindspore.so +0 -0
- mindspore/lib/libmindspore_backend.so +0 -0
- mindspore/lib/libmindspore_common.so +0 -0
- mindspore/lib/libmindspore_core.so +0 -0
- mindspore/lib/libmindspore_glog.so.0 +0 -0
- mindspore/lib/libmindspore_gpr.so.15 +0 -0
- mindspore/lib/libmindspore_grpc++.so.1 +0 -0
- mindspore/lib/libmindspore_grpc.so.15 +0 -0
- mindspore/lib/libmindspore_shared_lib.so +0 -0
- mindspore/lib/libmpi_adapter.so +0 -0
- mindspore/lib/libmpi_collective.so +0 -0
- mindspore/lib/libnnacl.so +0 -0
- mindspore/lib/libopencv_core.so.4.5 +0 -0
- mindspore/lib/libps_cache.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +0 -35
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/vector_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +0 -72
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/{aclnn_all_finite.h → aclnn_add_custom.h} +11 -9
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_decoder_kv_cache.h +1 -1
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_prompt_kv_cache.h +1 -1
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/lib/libcust_opapi.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +12 -184
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910/aic-ascend910-ops-info.json +15 -7
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +15 -7
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.cpp +81 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.py +134 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/decoder_kv_cache.py +31 -77
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/prompt_kv_cache.py +31 -77
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/inc/op_proto.h +5 -4
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
- mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
- mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
- mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
- mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
- mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/DeviceBin +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +286 -275
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/add_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -3
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/backend_param.h +0 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/cast/cast_tiling.h +45 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/compare_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_impl.h +4 -8
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_tiling.h +4 -11
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/kernel/flash_attention_score_mix_hwsync.h +0 -18
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_kernel.h +0 -6
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_rtbackend.h +75 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/kernel/matmul.h +5 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/matmul_impl.h +3 -18
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_common_tiling.h +5 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_info.h +2 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/tiling_data.h +3 -36
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/kernel/matmul_stridedslice_fusion.h +2 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/matmul_stridedslice_fusion_impl.h +4 -22
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +2 -16
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/kernel/paged_attention_mix_hwsync.h +3 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_impl.h +4 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_tiling.h +4 -9
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/attention_param.h +2 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_qkv_param.h +4 -10
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +12 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +1 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/backend.h +2 -10
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/elewise_utils.h +1 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +0 -17
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/math.h +7 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layernorm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_stridedslice_fusion_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libnot_equal_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblcal.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
- mindspore/mindrecord/filewriter.py +2 -2
- mindspore/mint/__init__.py +40 -720
- mindspore/mint/nn/__init__.py +7 -89
- mindspore/mint/nn/functional.py +16 -165
- mindspore/mint/optim/adamw.py +16 -15
- mindspore/nn/__init__.py +2 -0
- mindspore/nn/cell.py +98 -97
- mindspore/nn/extend/basic.py +2 -2
- mindspore/nn/extend/embedding.py +1 -1
- mindspore/nn/extend/layer/normalization.py +5 -7
- mindspore/nn/generator.py +297 -0
- mindspore/nn/layer/activation.py +3 -4
- mindspore/nn/layer/basic.py +16 -79
- mindspore/nn/layer/conv.py +8 -17
- mindspore/nn/layer/embedding.py +4 -1
- mindspore/nn/layer/math.py +1 -1
- mindspore/nn/layer/normalization.py +1 -1
- mindspore/nn/layer/pooling.py +0 -5
- mindspore/nn/layer/rnn_cells.py +2 -2
- mindspore/nn/loss/loss.py +19 -19
- mindspore/nn/optim/adasum.py +1 -1
- mindspore/nn/optim/sgd.py +2 -3
- mindspore/nn/probability/distribution/exponential.py +1 -1
- mindspore/nn/probability/distribution/geometric.py +1 -1
- mindspore/nn/probability/distribution/logistic.py +1 -1
- mindspore/nn/wrap/cell_wrapper.py +1 -25
- mindspore/nn/wrap/loss_scale.py +1 -24
- mindspore/numpy/array_ops.py +1 -5
- mindspore/numpy/dtypes.py +3 -3
- mindspore/numpy/math_ops.py +8 -8
- mindspore/ops/__init__.py +1 -1
- mindspore/ops/_grad_experimental/grad_comm_ops.py +16 -75
- mindspore/ops/_vmap/vmap_array_ops.py +0 -27
- mindspore/ops/_vmap/vmap_math_ops.py +1 -29
- mindspore/ops/_vmap/vmap_nn_ops.py +18 -19
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +8 -34
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +9 -2
- mindspore/ops/auto_generate/gen_arg_handler.py +0 -26
- mindspore/ops/auto_generate/gen_extend_func.py +27 -603
- mindspore/ops/auto_generate/gen_ops_def.py +203 -993
- mindspore/ops/auto_generate/gen_ops_prim.py +402 -1946
- mindspore/ops/auto_generate/pyboost_inner_prim.py +20 -90
- mindspore/ops/composite/base.py +6 -3
- mindspore/ops/composite/math_ops.py +1 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +17 -24
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
- mindspore/ops/extend/__init__.py +3 -2
- mindspore/ops/extend/array_func.py +51 -10
- mindspore/ops/extend/nn_func.py +78 -2
- mindspore/ops/function/__init__.py +13 -8
- mindspore/ops/function/array_func.py +179 -455
- mindspore/ops/function/clip_func.py +1 -1
- mindspore/ops/function/grad/grad_func.py +3 -3
- mindspore/ops/function/math_func.py +103 -117
- mindspore/ops/function/nn_func.py +163 -275
- mindspore/ops/function/other_func.py +2 -2
- mindspore/ops/function/random_func.py +69 -202
- mindspore/ops/function/sparse_func.py +4 -4
- mindspore/ops/functional.py +327 -332
- mindspore/ops/operations/__init__.py +3 -13
- mindspore/ops/operations/_grad_ops.py +27 -3
- mindspore/ops/operations/_inner_ops.py +356 -53
- mindspore/ops/operations/_rl_inner_ops.py +2 -2
- mindspore/ops/operations/_tensor_array.py +8 -8
- mindspore/ops/operations/array_ops.py +65 -82
- mindspore/ops/operations/comm_ops.py +93 -784
- mindspore/ops/operations/custom_ops.py +28 -51
- mindspore/ops/operations/debug_ops.py +4 -4
- mindspore/ops/operations/inner_ops.py +2 -2
- mindspore/ops/operations/manually_defined/ops_def.py +4 -304
- mindspore/ops/operations/math_ops.py +50 -3
- mindspore/ops/operations/nn_ops.py +247 -14
- mindspore/ops/operations/other_ops.py +3 -3
- mindspore/ops/operations/random_ops.py +1 -1
- mindspore/ops/operations/sparse_ops.py +1 -1
- mindspore/ops/primitive.py +8 -9
- mindspore/ops/silent_check.py +5 -5
- mindspore/ops_generate/arg_dtype_cast.py +9 -2
- mindspore/ops_generate/arg_handler.py +0 -26
- mindspore/ops_generate/gen_aclnn_implement.py +4 -1
- mindspore/ops_generate/gen_ops.py +4 -26
- mindspore/ops_generate/gen_pyboost_func.py +12 -41
- mindspore/ops_generate/gen_utils.py +0 -21
- mindspore/ops_generate/pyboost_utils.py +2 -7
- mindspore/ops_generate/template.py +0 -1
- mindspore/parallel/_auto_parallel_context.py +1 -21
- mindspore/parallel/_tensor.py +5 -0
- mindspore/parallel/_transformer/transformer.py +1 -1
- mindspore/parallel/_utils.py +1 -15
- mindspore/parallel/algo_parameter_config.py +3 -1
- mindspore/parallel/checkpoint_transform.py +9 -12
- mindspore/parallel/cluster/process_entity/_api.py +29 -28
- mindspore/parallel/cluster/process_entity/_utils.py +3 -13
- mindspore/parallel/cluster/run.py +16 -13
- mindspore/parallel/parameter_broadcast.py +2 -2
- mindspore/parallel/shard.py +17 -31
- mindspore/profiler/__init__.py +2 -3
- mindspore/profiler/common/util.py +2 -107
- mindspore/profiler/envprofiling.py +1 -1
- mindspore/profiler/parser/ascend_analysis/constant.py +21 -8
- mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -82
- mindspore/profiler/parser/ascend_analysis/function_event.py +28 -43
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +27 -49
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +10 -15
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +20 -25
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +5 -5
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +1 -10
- mindspore/profiler/parser/ascend_hccl_generator.py +1 -4
- mindspore/profiler/parser/ascend_msprof_exporter.py +22 -43
- mindspore/profiler/parser/ascend_timeline_generator.py +5 -7
- mindspore/profiler/parser/minddata_parser.py +3 -72
- mindspore/profiler/profiling.py +59 -176
- mindspore/rewrite/api/node.py +1 -1
- mindspore/rewrite/common/namespace.py +5 -5
- mindspore/rewrite/parsers/assign_parser.py +0 -2
- mindspore/rewrite/parsers/class_def_parser.py +4 -8
- mindspore/run_check/_check_version.py +1 -1
- mindspore/scipy/fft.py +3 -1
- mindspore/scipy/linalg.py +3 -2
- mindspore/scipy/ops.py +3 -5
- mindspore/scipy/optimize/__init__.py +2 -2
- mindspore/train/__init__.py +4 -4
- mindspore/train/anf_ir_pb2.py +2 -8
- mindspore/train/callback/__init__.py +2 -5
- mindspore/train/callback/_backup_and_restore.py +2 -2
- mindspore/train/callback/_checkpoint.py +16 -104
- mindspore/train/callback/_landscape.py +1 -1
- mindspore/train/callback/_time_monitor.py +1 -1
- mindspore/train/data_sink.py +4 -5
- mindspore/train/dataset_helper.py +20 -45
- mindspore/train/model.py +38 -266
- mindspore/train/serialization.py +105 -256
- mindspore/train/summary/_summary_adapter.py +1 -1
- mindspore/version.py +1 -1
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +2 -2
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +303 -420
- mindspore/_extends/pijit/__init__.py +0 -23
- mindspore/_extends/pijit/pijit_func_white_list.py +0 -343
- mindspore/common/file_system.py +0 -48
- mindspore/common/generator.py +0 -260
- mindspore/common/no_inline.py +0 -54
- mindspore/common/np_dtype.py +0 -25
- mindspore/communication/comm_func.py +0 -1140
- mindspore/hal/memory.py +0 -326
- mindspore/lib/libavcodec.so.59 +0 -0
- mindspore/lib/libavdevice.so.59 +0 -0
- mindspore/lib/libavfilter.so.8 +0 -0
- mindspore/lib/libavformat.so.59 +0 -0
- mindspore/lib/libavutil.so.57 +0 -0
- mindspore/lib/libmindspore_np_dtype.so +0 -0
- mindspore/lib/libswresample.so.4 +0 -0
- mindspore/lib/libswscale.so.6 +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.cpp +0 -326
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.py +0 -180
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/all_finite.json +0 -109
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/binary_info_config.json +0 -38
- mindspore/lib/plugin/ascend/custom_compiler/OWNERS +0 -12
- mindspore/lib/plugin/ascend/custom_compiler/setup.py +0 -255
- mindspore/lib/plugin/ascend/custom_compiler/start.sh +0 -26
- mindspore/lib/plugin/ascend/custom_compiler/template.json +0 -40
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme_op.h +0 -69
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/base_type.h +0 -133
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_creator.h +0 -32
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_param.h +0 -35
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/tiling_info.h +0 -60
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/kernel_register.h +0 -37
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/platform_configs.h +0 -89
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/rt_funcs.h +0 -135
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_op.h +0 -34
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_backoff_base.h +0 -62
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_elewise_op.h +0 -33
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_ops.h +0 -88
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_pa_op.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/cast_op.h +0 -52
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/matmul_op.h +0 -95
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/asd_utils.h +0 -84
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/comm_utils.h +0 -61
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp32.h +0 -224
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/and_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/div_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_impl.h +0 -48
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_tiling.h +0 -25
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/and_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/div_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_base.h +0 -260
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_kernel.h +0 -35
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/max_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/min_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/mul_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/or_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/max_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/min_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/mul_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/or_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/abs_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_impl.h +0 -47
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_tiling.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/exp_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/abs_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_base.h +0 -148
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_kernel.h +0 -31
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/exp_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/ln_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/not_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/reciprocal_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/relu_kernel.h +0 -55
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/rsqrt_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/sqrt_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/ln_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/not_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/reciprocal_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/relu_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/rsqrt_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/sqrt_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_impl.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_tiling.h +0 -187
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul.h +0 -245
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_interface.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_utils.h +0 -111
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/tiling_data.h +0 -54
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/compare_param.h +0 -31
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/elewise_param.h +0 -41
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/grouped_matmul_param.h +0 -40
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/profiling_util.h +0 -364
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_utils.h +0 -69
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_creator.h +0 -39
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_registry.h +0 -114
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/utils.h +0 -98
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.json +0 -19
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aic_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aiv_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.json +0 -19
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aic_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aiv_0.o +0 -0
- mindspore/mint/linalg/__init__.py +0 -22
- mindspore/nn/layer/embedding_service.py +0 -531
- mindspore/nn/layer/embedding_service_layer.py +0 -393
- mindspore/ops/function/reshard_func.py +0 -102
- mindspore/ops/operations/_infer_ops.py +0 -19
- mindspore/ops/operations/reshard_ops.py +0 -53
- mindspore/profiler/common/process_pool.py +0 -41
- mindspore/profiler/common/singleton.py +0 -28
- mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
- mindspore/profiler/parser/ascend_memory_generator.py +0 -185
- mindspore/train/callback/_cluster_monitor.py +0 -201
- mindspore/train/callback/_flops_collector.py +0 -238
- mindspore/train/callback/_mindio_ttp.py +0 -443
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/entry_points.txt +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -248,7 +248,7 @@ def clamp(input, min=None, max=None):
|
|
|
248
248
|
max (Union(Tensor, float, int), optional): The maximum value. Default: ``None`` .
|
|
249
249
|
|
|
250
250
|
Returns:
|
|
251
|
-
Tensor, a clipped Tensor.
|
|
251
|
+
Union(Tensor), a clipped Tensor.
|
|
252
252
|
The data type and shape are the same as input.
|
|
253
253
|
|
|
254
254
|
Raises:
|
|
@@ -483,7 +483,7 @@ def jet(fn, primals, series):
|
|
|
483
483
|
>>> import numpy as np
|
|
484
484
|
>>> import mindspore.nn as nn
|
|
485
485
|
>>> import mindspore as ms
|
|
486
|
-
>>>
|
|
486
|
+
>>> import mindspore.ops as ops
|
|
487
487
|
>>> from mindspore import Tensor
|
|
488
488
|
>>> ms.set_context(mode=ms.GRAPH_MODE)
|
|
489
489
|
>>> class Net(nn.Cell):
|
|
@@ -593,7 +593,7 @@ def derivative(fn, primals, order):
|
|
|
593
593
|
>>> import numpy as np
|
|
594
594
|
>>> import mindspore as ms
|
|
595
595
|
>>> import mindspore.nn as nn
|
|
596
|
-
>>>
|
|
596
|
+
>>> import mindspore.ops as ops
|
|
597
597
|
>>> from mindspore import Tensor
|
|
598
598
|
>>> ms.set_context(mode=ms.GRAPH_MODE)
|
|
599
599
|
>>> class Net(nn.Cell):
|
|
@@ -1388,7 +1388,7 @@ def stop_gradient(value):
|
|
|
1388
1388
|
``Ascend`` ``GPU`` ``CPU``
|
|
1389
1389
|
|
|
1390
1390
|
Examples:
|
|
1391
|
-
>>>
|
|
1391
|
+
>>> import mindspore.ops as ops
|
|
1392
1392
|
>>> from mindspore import Tensor
|
|
1393
1393
|
>>> from mindspore import dtype as mstype
|
|
1394
1394
|
>>> def net(x, y):
|
|
@@ -43,8 +43,8 @@ from mindspore.ops.auto_generate import (minimum, maximum, mul, sin, sinc, sinh,
|
|
|
43
43
|
matrix_exp, sqrt, rsqrt, square, trace, nextafter, abs, acos, acosh, angle,
|
|
44
44
|
asin, asinh, atan, atan2, atanh, ceil, equal, erf, erfc, erfinv, exp, expm1,
|
|
45
45
|
floor, floor_divide, floor_mod, gcd, greater, greater_equal, less, less_equal,
|
|
46
|
-
log, log1p, neg, not_equal, pow, round, isfinite,
|
|
47
|
-
sum_ext_op, prod_ext_op, all
|
|
46
|
+
log, log1p, neg, not_equal, pow, round, isfinite, argmax, mean_ext_op,
|
|
47
|
+
sum_ext_op, prod_ext_op, all)
|
|
48
48
|
from mindspore.ops.auto_generate import tanh
|
|
49
49
|
from mindspore.nn import layer
|
|
50
50
|
from mindspore._checkparam import check_is_number
|
|
@@ -131,8 +131,6 @@ pows = tensor_pow
|
|
|
131
131
|
tensor_sub = P.Sub()
|
|
132
132
|
transpose_ = P.Transpose()
|
|
133
133
|
xdivy_ = P.Xdivy()
|
|
134
|
-
tensor_div_ = P.Div()
|
|
135
|
-
tensor_divmod_ = DivMod()
|
|
136
134
|
|
|
137
135
|
#####################################
|
|
138
136
|
# Private Operation Functions.
|
|
@@ -762,9 +760,9 @@ def div(input, other, *, rounding_mode=None):
|
|
|
762
760
|
if rounding_mode is not None and rounding_mode not in ['floor', 'trunc']:
|
|
763
761
|
raise ValueError("For ops.div, rounding_mode value should be None, 'floor' or 'trunc'.")
|
|
764
762
|
if rounding_mode:
|
|
765
|
-
output =
|
|
763
|
+
output = DivMod()(input, other, rounding_mode)
|
|
766
764
|
else:
|
|
767
|
-
output =
|
|
765
|
+
output = P.Div()(input, other)
|
|
768
766
|
return output
|
|
769
767
|
|
|
770
768
|
|
|
@@ -1263,6 +1261,49 @@ def logical_and(input, other):
|
|
|
1263
1261
|
return logical_and_(input, other)
|
|
1264
1262
|
|
|
1265
1263
|
|
|
1264
|
+
def sign(input):
|
|
1265
|
+
r"""
|
|
1266
|
+
Returns an element-wise indication of the sign of a number.
|
|
1267
|
+
|
|
1268
|
+
.. math::
|
|
1269
|
+
\text{out}_{i} = \begin{cases}
|
|
1270
|
+
-1 & \text{input}_{i} < 0 \\
|
|
1271
|
+
0 & \text{input}_{i} = 0 \\
|
|
1272
|
+
1 & \text{input}_{i} > 0
|
|
1273
|
+
\end{cases}
|
|
1274
|
+
|
|
1275
|
+
Args:
|
|
1276
|
+
input (Tensor): Input Tensor.
|
|
1277
|
+
|
|
1278
|
+
Returns:
|
|
1279
|
+
Tensor, the sign of input.
|
|
1280
|
+
|
|
1281
|
+
Raises:
|
|
1282
|
+
TypeError: If `input` is not a Tensor.
|
|
1283
|
+
|
|
1284
|
+
Supported Platforms:
|
|
1285
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
1286
|
+
|
|
1287
|
+
Examples:
|
|
1288
|
+
>>> import mindspore as ms
|
|
1289
|
+
>>> import mindspore.ops as ops
|
|
1290
|
+
>>> input = ms.Tensor([[-1, 0, 2, 4, 6], [2, 3, 5, -6, 0]])
|
|
1291
|
+
>>> output = ops.sign(input)
|
|
1292
|
+
>>> print(output)
|
|
1293
|
+
[[-1 0 1 1 1]
|
|
1294
|
+
[ 1 1 1 -1 0]]
|
|
1295
|
+
>>> ms.set_context(device_target="CPU")
|
|
1296
|
+
>>> x = ms.Tensor([[-1, 0, float('inf'), 4, float('nan')], [2, 3, float('-inf'), -6, 0]])
|
|
1297
|
+
>>> output = ops.sign(x)
|
|
1298
|
+
>>> print(output)
|
|
1299
|
+
[[-1. 0. 1. 1. 0.]
|
|
1300
|
+
[ 1. 1. -1. -1. 0.]]
|
|
1301
|
+
"""
|
|
1302
|
+
if not isinstance(input, Tensor):
|
|
1303
|
+
raise TypeError(f"For sign, the input must be a Tensor, but got {type(input)}")
|
|
1304
|
+
return sign_(input)
|
|
1305
|
+
|
|
1306
|
+
|
|
1266
1307
|
def signbit(input):
|
|
1267
1308
|
r"""
|
|
1268
1309
|
Determine the symbol of each element. If the element value is less than 0,
|
|
@@ -1282,7 +1323,7 @@ def signbit(input):
|
|
|
1282
1323
|
|
|
1283
1324
|
Examples:
|
|
1284
1325
|
>>> import mindspore as ms
|
|
1285
|
-
>>>
|
|
1326
|
+
>>> import mindspore.ops as ops
|
|
1286
1327
|
>>> input = ms.Tensor([0.3, 1.2, 0., -2.5])
|
|
1287
1328
|
>>> output = ops.signbit(input)
|
|
1288
1329
|
>>> print(output)
|
|
@@ -1320,7 +1361,7 @@ def sgn(input):
|
|
|
1320
1361
|
|
|
1321
1362
|
Examples:
|
|
1322
1363
|
>>> import mindspore as ms
|
|
1323
|
-
>>>
|
|
1364
|
+
>>> import mindspore.ops as ops
|
|
1324
1365
|
>>> input = ms.Tensor([[3 + 4j, 7 - 24j, 0, 6 + 8j, 8], [15 + 20j, 7 - 24j, 0, 3 + 4j, 20]], dtype=ms.complex64)
|
|
1325
1366
|
>>> output = ops.sgn(input)
|
|
1326
1367
|
>>> print(output)
|
|
@@ -1336,7 +1377,7 @@ def sgn(input):
|
|
|
1336
1377
|
non_zero_modulus = ops.masked_fill(modulus, zeros_mask, ops.cast(1, modulus.dtype))
|
|
1337
1378
|
zeros_modulus = ops.zeros_like(non_zero_modulus)
|
|
1338
1379
|
complex_modulus = ops.Complex()(non_zero_modulus, zeros_modulus)
|
|
1339
|
-
res =
|
|
1380
|
+
res = input / complex_modulus
|
|
1340
1381
|
return res
|
|
1341
1382
|
|
|
1342
1383
|
|
|
@@ -1367,7 +1408,7 @@ def cosine_similarity(x1, x2, dim=1, eps=1e-08):
|
|
|
1367
1408
|
|
|
1368
1409
|
Examples:
|
|
1369
1410
|
>>> import mindspore as ms
|
|
1370
|
-
>>>
|
|
1411
|
+
>>> import mindspore.ops as ops
|
|
1371
1412
|
>>> x1 = ms.Tensor([[-0.0256, 0.0127, -0.2475, 0.2316, 0.8037],
|
|
1372
1413
|
... [0.5809, -1.2712, -0.7038, -0.2558, 0.7494]], dtype=ms.float32)
|
|
1373
1414
|
>>> x2 = ms.Tensor([[-0.6115, -0.1965, -0.8484, 0.2389, 0.2409],
|
|
@@ -1469,7 +1510,7 @@ def cov(input, *, correction=1, fweights=None, aweights=None):
|
|
|
1469
1510
|
|
|
1470
1511
|
Examples:
|
|
1471
1512
|
>>> import mindspore as ms
|
|
1472
|
-
>>>
|
|
1513
|
+
>>> import mindspore.ops as ops
|
|
1473
1514
|
>>> x = ms.Tensor([[0., 3.], [5., 5.], [7., 0.]]).T
|
|
1474
1515
|
>>> print(x)
|
|
1475
1516
|
[[0. 5. 7.]
|
|
@@ -1714,26 +1755,6 @@ def arctan2(input, other):
|
|
|
1714
1755
|
return atan2_(input, other)
|
|
1715
1756
|
|
|
1716
1757
|
|
|
1717
|
-
def arctan2_ext(input, other):
|
|
1718
|
-
r"""
|
|
1719
|
-
Alias for :func:`mindspore.ops.atan2_ext`.
|
|
1720
|
-
|
|
1721
|
-
Supported Platforms:
|
|
1722
|
-
``Ascend``
|
|
1723
|
-
|
|
1724
|
-
Examples:
|
|
1725
|
-
>>> import mindspore
|
|
1726
|
-
>>> from mindspore import Tensor, ops
|
|
1727
|
-
>>> import numpy as np
|
|
1728
|
-
>>> x = Tensor(np.array([0, 1]), mindspore.float32)
|
|
1729
|
-
>>> y = Tensor(np.array([1, 1]), mindspore.float32)
|
|
1730
|
-
>>> output = ops.arctan2_ext(x, y)
|
|
1731
|
-
>>> print(output)
|
|
1732
|
-
[0. 0.7853982]
|
|
1733
|
-
"""
|
|
1734
|
-
return atan2_ext(input, other)
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
1758
|
def polar(abs, angle): # pylint: disable=redefined-outer-name
|
|
1738
1759
|
r"""
|
|
1739
1760
|
Converts polar coordinates to Cartesian coordinates.
|
|
@@ -2073,7 +2094,7 @@ def inverse(input):
|
|
|
2073
2094
|
|
|
2074
2095
|
Args:
|
|
2075
2096
|
input (Tensor): A matrix to be calculated. Input `input` must be at least two dimensions, and the size of
|
|
2076
|
-
the last two dimensions must be the same size.
|
|
2097
|
+
the last two dimensions must be the same size.
|
|
2077
2098
|
|
|
2078
2099
|
Returns:
|
|
2079
2100
|
Tensor, has the same type and shape as input `input`.
|
|
@@ -2098,36 +2119,6 @@ def inverse(input):
|
|
|
2098
2119
|
return matrix_inverse_(input)
|
|
2099
2120
|
|
|
2100
2121
|
|
|
2101
|
-
def inverse_ext(input):
|
|
2102
|
-
"""
|
|
2103
|
-
Compute the inverse of the input matrix.
|
|
2104
|
-
|
|
2105
|
-
Args:
|
|
2106
|
-
input (Tensor): A matrix to be calculated. Input `input` must be at least two dimensions, and the size of
|
|
2107
|
-
the last two dimensions must be the same size. And the matrix must be invertible.
|
|
2108
|
-
|
|
2109
|
-
Returns:
|
|
2110
|
-
Tensor, has the same type and shape as input `input`.
|
|
2111
|
-
|
|
2112
|
-
Raises:
|
|
2113
|
-
ValueError: If the size of the last two dimensions of `input` is not the same.
|
|
2114
|
-
ValueError: If `input` is not empty and its dimensions are less than 2.
|
|
2115
|
-
ValueError: If the dimensions of `input` are larger than 6.
|
|
2116
|
-
|
|
2117
|
-
Supported Platforms:
|
|
2118
|
-
``Ascend``
|
|
2119
|
-
|
|
2120
|
-
Examples:
|
|
2121
|
-
>>> from mindspore import Tensor, ops
|
|
2122
|
-
>>> from mindspore import dtype as mstype
|
|
2123
|
-
>>> x = Tensor([[1., 2.], [3., 4.]], mstype.float32)
|
|
2124
|
-
>>> print(ops.inverse_ext(x))
|
|
2125
|
-
[[-2. 1. ]
|
|
2126
|
-
[ 1.5 -0.5]]
|
|
2127
|
-
"""
|
|
2128
|
-
return matrix_inverse_ext(input)
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
2122
|
def invert(x):
|
|
2132
2123
|
r"""
|
|
2133
2124
|
Flips all bits of input tensor element-wise.
|
|
@@ -2582,7 +2573,7 @@ def linspace_ext(start, end, steps, *, dtype=None):
|
|
|
2582
2573
|
>>> start = Tensor(1, mindspore.float32)
|
|
2583
2574
|
>>> end = Tensor(10, mindspore.float32)
|
|
2584
2575
|
>>> steps = 5
|
|
2585
|
-
>>> output = ops.
|
|
2576
|
+
>>> output = ops.linspace_ext(start, end, steps, dtype=mindspore.float32)
|
|
2586
2577
|
>>> print(output)
|
|
2587
2578
|
[ 1. 3.25 5.5 7.75 10. ]
|
|
2588
2579
|
"""
|
|
@@ -3174,7 +3165,6 @@ def eq(input, other):
|
|
|
3174
3165
|
|
|
3175
3166
|
Note:
|
|
3176
3167
|
- `input` and `other` comply with the implicit type conversion rules to make the data types consistent.
|
|
3177
|
-
- The input must be two Tensors, or a Tensor and a Scalar.
|
|
3178
3168
|
- The shapes of the inputs can be broadcasted to each other.
|
|
3179
3169
|
|
|
3180
3170
|
Args:
|
|
@@ -3359,24 +3349,23 @@ def isclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False):
|
|
|
3359
3349
|
|input-other| ≤ atol + rtol × |other|
|
|
3360
3350
|
|
|
3361
3351
|
Args:
|
|
3362
|
-
input (Tensor): First
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
atol (Union[float, int, bool], optional): Absolute tolerance. Default: ``1e-08`` .
|
|
3368
|
-
equal_nan (bool, optional): If ``True`` , then two NaNs will be considered equal. Default: ``False``.
|
|
3352
|
+
input (Tensor): First Tensor to compare, with data type belongs to float32, float16, int32.
|
|
3353
|
+
other (Tensor): Second Tensor to compare, with data type belongs to float32, float16, int32.
|
|
3354
|
+
rtol (float, optional): Relative tolerance. Default: ``1e-05`` .
|
|
3355
|
+
atol (float, optional): Absolute tolerance. Default: ``1e-08`` .
|
|
3356
|
+
equal_nan (bool, optional): If True, then two NaNs will be considered equal. Default: ``False`` .
|
|
3369
3357
|
|
|
3370
3358
|
Returns:
|
|
3371
3359
|
A bool Tensor, with the shape as broadcasted result of the input `input` and `other`.
|
|
3372
3360
|
|
|
3373
3361
|
Raises:
|
|
3374
|
-
TypeError: `input`
|
|
3375
|
-
TypeError: `input`
|
|
3376
|
-
TypeError: `atol`
|
|
3377
|
-
TypeError: `equal_nan` is not bool.
|
|
3378
|
-
TypeError: `input`
|
|
3379
|
-
ValueError: `input` and `other`
|
|
3362
|
+
TypeError: If either of `input` and `other` is not Tensor.
|
|
3363
|
+
TypeError: If either of `input` and `other` is not float16, float32 or int32.
|
|
3364
|
+
TypeError: If either of `atol` and `rtol` is not float.
|
|
3365
|
+
TypeError: If `equal_nan` is not bool.
|
|
3366
|
+
TypeError: If the dtype of `input` is not same as the `other`.
|
|
3367
|
+
ValueError: If `input` and `other` can not be broadcast.
|
|
3368
|
+
ValueError: If either of `atol` and `rtol` is less than zero.
|
|
3380
3369
|
|
|
3381
3370
|
Supported Platforms:
|
|
3382
3371
|
``Ascend`` ``GPU`` ``CPU``
|
|
@@ -4481,7 +4470,7 @@ def reciprocal(input):
|
|
|
4481
4470
|
|
|
4482
4471
|
Examples:
|
|
4483
4472
|
>>> import mindspore as ms
|
|
4484
|
-
>>>
|
|
4473
|
+
>>> import mindspore.ops as ops
|
|
4485
4474
|
>>> import numpy as np
|
|
4486
4475
|
>>> input = ms.Tensor(np.array([1.0, 2.0, 4.0]), ms.float32)
|
|
4487
4476
|
>>> output = ops.reciprocal(input)
|
|
@@ -5008,7 +4997,7 @@ def bernoulli(input, p=0.5, seed=None):
|
|
|
5008
4997
|
>>> import mindspore
|
|
5009
4998
|
>>> import numpy as np
|
|
5010
4999
|
>>> from mindspore import Tensor
|
|
5011
|
-
>>>
|
|
5000
|
+
>>> import mindspore.ops as ops
|
|
5012
5001
|
>>> input_x = Tensor(np.array([1, 2, 3]), mindspore.int8)
|
|
5013
5002
|
>>> output = ops.bernoulli(input_x, p=1.0)
|
|
5014
5003
|
>>> print(output)
|
|
@@ -5245,7 +5234,7 @@ def rad2deg(x):
|
|
|
5245
5234
|
Examples:
|
|
5246
5235
|
>>> import mindspore
|
|
5247
5236
|
>>> from mindspore import Tensor
|
|
5248
|
-
>>>
|
|
5237
|
+
>>> import mindspore.ops as ops
|
|
5249
5238
|
>>> x = Tensor([[6.283, -3.142],[1.570, -6.283],[3.142, -1.570]], mindspore.float32)
|
|
5250
5239
|
>>> output = ops.rad2deg(x)
|
|
5251
5240
|
>>> print(output)
|
|
@@ -5285,7 +5274,7 @@ def frac(x):
|
|
|
5285
5274
|
>>> import mindspore
|
|
5286
5275
|
>>> from mindspore import Tensor
|
|
5287
5276
|
>>> from mindspore import dtype as mstype
|
|
5288
|
-
>>>
|
|
5277
|
+
>>> import mindspore.ops as ops
|
|
5289
5278
|
>>> x = Tensor([2, 4.2, -2.5], mstype.float16)
|
|
5290
5279
|
>>> output = ops.frac(x)
|
|
5291
5280
|
>>> print(output)
|
|
@@ -5406,7 +5395,7 @@ def cumsum(x, axis, dtype=None):
|
|
|
5406
5395
|
>>> import mindspore
|
|
5407
5396
|
>>> import numpy as np
|
|
5408
5397
|
>>> from mindspore import Tensor
|
|
5409
|
-
>>>
|
|
5398
|
+
>>> import mindspore.ops as ops
|
|
5410
5399
|
>>> x = Tensor(np.array([[3, 4, 6, 10], [1, 6, 7, 9], [4, 3, 8, 7], [1, 3, 7, 9]]).astype(np.float32))
|
|
5411
5400
|
>>> # case 1: along the axis 0
|
|
5412
5401
|
>>> y = ops.cumsum(x, 0)
|
|
@@ -6243,7 +6232,7 @@ def copysign(x, other):
|
|
|
6243
6232
|
|
|
6244
6233
|
Examples:
|
|
6245
6234
|
>>> import mindspore.numpy as np
|
|
6246
|
-
>>>
|
|
6235
|
+
>>> import mindspore.ops as ops
|
|
6247
6236
|
>>> x = np.array([[0.3, -0.7], [0.5, 0.5]])
|
|
6248
6237
|
>>> other = np.array([[-0.4, 0.6], [0.4, -0.6]])
|
|
6249
6238
|
>>> out = ops.copysign(x, other)
|
|
@@ -6389,7 +6378,7 @@ def logcumsumexp(input, axis):
|
|
|
6389
6378
|
|
|
6390
6379
|
Examples:
|
|
6391
6380
|
>>> import mindspore as ms
|
|
6392
|
-
>>>
|
|
6381
|
+
>>> import mindspore.ops as ops
|
|
6393
6382
|
>>> import numpy as np
|
|
6394
6383
|
>>> x = ms.Tensor(np.array([1.0, 2.0, 3.0]).astype(np.float32))
|
|
6395
6384
|
>>> output = ops.logcumsumexp(x, 0)
|
|
@@ -6661,15 +6650,11 @@ def mean(x, axis=None, keep_dims=False):
|
|
|
6661
6650
|
And reduce a dimension of `x` along the specified `axis`. `keep_dims`
|
|
6662
6651
|
determines whether the dimensions of the output and input are the same.
|
|
6663
6652
|
|
|
6664
|
-
Note:
|
|
6665
|
-
The `axis` with tensor type is only used for compatibility with older versions and is not recommended.
|
|
6666
|
-
|
|
6667
6653
|
Args:
|
|
6668
6654
|
x (Tensor[Number]): The input tensor. The dtype of the tensor to be reduced is number.
|
|
6669
6655
|
:math:`(N, *)` where :math:`*` means, any number of additional dimensions.
|
|
6670
|
-
axis (Union[int, tuple(int), list(int)
|
|
6671
|
-
|
|
6672
|
-
and the value range is [-r,r).
|
|
6656
|
+
axis (Union[int, tuple(int), list(int)]): The dimensions to reduce. Default: ``None`` , reduce all dimensions.
|
|
6657
|
+
Only constant value is allowed. Assume the rank of `x` is r, and the value range is [-r,r).
|
|
6673
6658
|
keep_dims (bool): If true, keep these reduced dimensions and the length is 1.
|
|
6674
6659
|
If false, don't keep these dimensions. Default: ``False`` .
|
|
6675
6660
|
|
|
@@ -6685,7 +6670,7 @@ def mean(x, axis=None, keep_dims=False):
|
|
|
6685
6670
|
|
|
6686
6671
|
Raises:
|
|
6687
6672
|
TypeError: If `x` is not a Tensor.
|
|
6688
|
-
TypeError: If `axis` is not one of the following: int, tuple
|
|
6673
|
+
TypeError: If `axis` is not one of the following: int, tuple or list.
|
|
6689
6674
|
TypeError: If `keep_dims` is not a bool.
|
|
6690
6675
|
ValueError: If `axis` is out of range.
|
|
6691
6676
|
|
|
@@ -6761,19 +6746,19 @@ def mean_ext(input, axis=None, keep_dims=False, dtype=None):
|
|
|
6761
6746
|
dtype (:class:`mindspore.dtype`): The desired data type of returned Tensor. Default: ``None`` .
|
|
6762
6747
|
|
|
6763
6748
|
Returns:
|
|
6764
|
-
Tensor, has the same data type as
|
|
6749
|
+
Tensor, has the same data type as input tensor.
|
|
6765
6750
|
|
|
6766
6751
|
- If `axis` is ``None`` , and `keep_dims` is ``False`` ,
|
|
6767
|
-
|
|
6752
|
+
the output is a 0-D tensor representing the product of all elements in the input tensor.
|
|
6768
6753
|
- If `axis` is int, set as 1, and `keep_dims` is ``False`` ,
|
|
6769
|
-
|
|
6754
|
+
the shape of output is :math:`(x_0, x_2, ..., x_R)`.
|
|
6770
6755
|
- If `axis` is tuple(int), set as (1, 2), and `keep_dims` is ``False`` ,
|
|
6771
|
-
|
|
6756
|
+
the shape of output is :math:`(x_0, x_3, ..., x_R)`.
|
|
6772
6757
|
- If `axis` is 1-D Tensor, set as [1, 2], and `keep_dims` is ``False`` ,
|
|
6773
|
-
|
|
6758
|
+
the shape of output is :math:`(x_0, x_3, ..., x_R)`.
|
|
6774
6759
|
|
|
6775
6760
|
Raises:
|
|
6776
|
-
TypeError: If `
|
|
6761
|
+
TypeError: If `x` is not a Tensor.
|
|
6777
6762
|
TypeError: If `axis` is not one of the following: int, tuple, list or Tensor.
|
|
6778
6763
|
TypeError: If `keep_dims` is not a bool.
|
|
6779
6764
|
ValueError: If `axis` is out of range.
|
|
@@ -6786,7 +6771,7 @@ def mean_ext(input, axis=None, keep_dims=False, dtype=None):
|
|
|
6786
6771
|
>>> import numpy as np
|
|
6787
6772
|
>>> from mindspore import Tensor, ops
|
|
6788
6773
|
>>> x = Tensor(np.random.randn(3, 4, 5, 6).astype(np.float32))
|
|
6789
|
-
>>> output = ops.
|
|
6774
|
+
>>> output = ops.mean(x, 1, keep_dims=True)
|
|
6790
6775
|
>>> result = output.shape
|
|
6791
6776
|
>>> print(result)
|
|
6792
6777
|
(3, 1, 5, 6)
|
|
@@ -6795,25 +6780,25 @@ def mean_ext(input, axis=None, keep_dims=False, dtype=None):
|
|
|
6795
6780
|
... [[4, 4, 4, 4, 4, 4], [5, 5, 5, 5, 5, 5], [6, 6, 6, 6, 6, 6]],
|
|
6796
6781
|
... [[6, 6, 6, 6, 6, 6], [8, 8, 8, 8, 8, 8], [10, 10, 10, 10, 10, 10]]]),
|
|
6797
6782
|
... mindspore.float32)
|
|
6798
|
-
>>> output = ops.
|
|
6783
|
+
>>> output = ops.mean(x)
|
|
6799
6784
|
>>> print(output)
|
|
6800
6785
|
5.0
|
|
6801
6786
|
>>> print(output.shape)
|
|
6802
6787
|
()
|
|
6803
6788
|
>>> # case 2: Reduces a dimension along the axis 0
|
|
6804
|
-
>>> output = ops.
|
|
6789
|
+
>>> output = ops.mean(x, 0, True)
|
|
6805
6790
|
>>> print(output)
|
|
6806
6791
|
[[[4. 4. 4. 4. 4. 4.]
|
|
6807
6792
|
[5. 5. 5. 5. 5. 5.]
|
|
6808
6793
|
[6. 6. 6. 6. 6. 6.]]]
|
|
6809
6794
|
>>> # case 3: Reduces a dimension along the axis 1
|
|
6810
|
-
>>> output = ops.
|
|
6795
|
+
>>> output = ops.mean(x, 1, True)
|
|
6811
6796
|
>>> print(output)
|
|
6812
6797
|
[[[2. 2. 2. 2. 2. 2.]]
|
|
6813
6798
|
[[5. 5. 5. 5. 5. 5.]]
|
|
6814
6799
|
[[8. 8. 8. 8. 8. 8.]]]
|
|
6815
6800
|
>>> # case 4: Reduces a dimension along the axis 2
|
|
6816
|
-
>>> output = ops.
|
|
6801
|
+
>>> output = ops.mean(x, 2, True)
|
|
6817
6802
|
>>> print(output)
|
|
6818
6803
|
[[[ 2.]
|
|
6819
6804
|
[ 2.]
|
|
@@ -6847,7 +6832,7 @@ def prod(input, axis=None, keep_dims=False, dtype=None):
|
|
|
6847
6832
|
dtype (:class:`mindspore.dtype`): The desired data type of returned Tensor. Default: ``None`` .
|
|
6848
6833
|
|
|
6849
6834
|
Returns:
|
|
6850
|
-
Tensor, has the same data type as
|
|
6835
|
+
Tensor, has the same data type as input tensor.
|
|
6851
6836
|
|
|
6852
6837
|
- If `axis` is ``None`` , and `keep_dims` is ``False`` ,
|
|
6853
6838
|
the output is a 0-D tensor representing the product of all elements in the input tensor.
|
|
@@ -7072,7 +7057,7 @@ def norm(A, ord=None, dim=None, keepdim=False, *, dtype=None):
|
|
|
7072
7057
|
|
|
7073
7058
|
Examples:
|
|
7074
7059
|
>>> import mindspore as ms
|
|
7075
|
-
>>>
|
|
7060
|
+
>>> import mindspore.ops as ops
|
|
7076
7061
|
>>> data_range = ops.arange(-13, 13, dtype=ms.float32)
|
|
7077
7062
|
>>> # Exclude 0 from original data for 0 is invalid input when `ord` is negative.
|
|
7078
7063
|
>>> x = data_range[data_range != 0]
|
|
@@ -7336,16 +7321,16 @@ def norm_ext(A, ord=None, dim=None, keepdim=False, *, dtype=None):
|
|
|
7336
7321
|
``Ascend``
|
|
7337
7322
|
|
|
7338
7323
|
Note:
|
|
7339
|
-
Currently, it only support `ops.
|
|
7324
|
+
Currently, it only support `ops.norm_ext(A)`.
|
|
7340
7325
|
|
|
7341
7326
|
Examples:
|
|
7342
7327
|
>>> import mindspore as ms
|
|
7343
|
-
>>>
|
|
7328
|
+
>>> import mindspore.ops as ops
|
|
7344
7329
|
>>> data_range = ops.arange(-13, 13, dtype=ms.float32)
|
|
7345
7330
|
>>> # Exclude 0 from original data for 0 is invalid input when `ord` is negative.
|
|
7346
7331
|
>>> x = data_range[data_range != 0]
|
|
7347
7332
|
>>> y = x.reshape(5, 5)
|
|
7348
|
-
>>> print(ops.
|
|
7333
|
+
>>> print(ops.norm_ext(x))
|
|
7349
7334
|
38.327538
|
|
7350
7335
|
>>> print(ops.norm(x, 0))
|
|
7351
7336
|
25.0
|
|
@@ -7761,11 +7746,6 @@ def gumbel_softmax(logits, tau=1.0, hard=False, dim=-1):
|
|
|
7761
7746
|
_check_logits_shape(logits)
|
|
7762
7747
|
logits_dtype = dtype_(logits)
|
|
7763
7748
|
_check_input_dtype("logits", logits_dtype, [mstype.float16, mstype.float32], "gumbel_softmax")
|
|
7764
|
-
valid_types = [mstype.float16, mstype.float32]
|
|
7765
|
-
if logits_dtype not in valid_types:
|
|
7766
|
-
names = [t.__name__ if hasattr(t, "__name__") else t for t in valid_types]
|
|
7767
|
-
logits_dtype = logits_dtype.__name__ if hasattr(logits_dtype, '__name__') else repr(logits_dtype)
|
|
7768
|
-
raise TypeError(f"For 'gumbel_softmax', the 'logits' should be one of '{names}', but got type '{logits_dtype}'")
|
|
7769
7749
|
_check_attr_dtype("tau", tau, [float], "gumbel_softmax")
|
|
7770
7750
|
_check_attr_dtype("hard", hard, [bool], "gumbel_softmax")
|
|
7771
7751
|
_check_attr_dtype("dim", dim, [int], "gumbel_softmax")
|
|
@@ -8054,6 +8034,8 @@ def matmul(input, other):
|
|
|
8054
8034
|
Note:
|
|
8055
8035
|
Numpy arguments `out`, `casting`, `order`, `subok`, `signature`, and `extobj` are
|
|
8056
8036
|
not supported.
|
|
8037
|
+
On GPU, the supported dtypes are np.float16 and np.float32.
|
|
8038
|
+
On CPU, the supported dtypes are np.float16 and np.float32.
|
|
8057
8039
|
The dtype of `input` and `other` must be same.
|
|
8058
8040
|
On Ascend, the rank of `input` or `other` must be between 1 and 6.
|
|
8059
8041
|
|
|
@@ -8074,7 +8056,7 @@ def matmul(input, other):
|
|
|
8074
8056
|
ValueError: If the last dimension of `input` is not the same size as the
|
|
8075
8057
|
second-to-last dimension of `other`, or if a scalar value is passed in.
|
|
8076
8058
|
ValueError: If the shape of `input` and `input` could not broadcast together.
|
|
8077
|
-
RuntimeError: If the rank of `input` or `other` is less than 1 or greater than 6
|
|
8059
|
+
RuntimeError: If the rank of `input` or `other` is less than 1 or greater than 6.
|
|
8078
8060
|
|
|
8079
8061
|
Supported Platforms:
|
|
8080
8062
|
``Ascend`` ``GPU`` ``CPU``
|
|
@@ -8561,7 +8543,7 @@ def roll(input, shifts, dims=None):
|
|
|
8561
8543
|
Examples:
|
|
8562
8544
|
>>> import numpy as np
|
|
8563
8545
|
>>> import mindspore as ms
|
|
8564
|
-
>>>
|
|
8546
|
+
>>> import mindspore.ops as ops
|
|
8565
8547
|
>>> from mindspore import Tensor
|
|
8566
8548
|
>>> input_x = Tensor(np.array([0, 1, 2, 3, 4]).astype(np.float32))
|
|
8567
8549
|
>>> output = ops.roll(input_x, shifts=2, dims=0)
|
|
@@ -10105,7 +10087,7 @@ def sum(input, dim=None, keepdim=False, *, dtype=None):
|
|
|
10105
10087
|
dtype (:class:`mindspore.dtype`, optional): The desired data type of returned Tensor. Default: ``None`` .
|
|
10106
10088
|
|
|
10107
10089
|
Returns:
|
|
10108
|
-
|
|
10090
|
+
A Tensor, sum of elements over a given `dim` in `input`.
|
|
10109
10091
|
|
|
10110
10092
|
Raises:
|
|
10111
10093
|
TypeError: If `input` is not a Tensor.
|
|
@@ -10156,7 +10138,7 @@ def tanhshrink(input):
|
|
|
10156
10138
|
|
|
10157
10139
|
Examples:
|
|
10158
10140
|
>>> import mindspore as ms
|
|
10159
|
-
>>>
|
|
10141
|
+
>>> import mindspore.ops as ops
|
|
10160
10142
|
>>> from mindspore import Tensor
|
|
10161
10143
|
>>> import numpy as np
|
|
10162
10144
|
>>> input = Tensor(np.array([1, 2, 3, 2, 1]), ms.float16)
|
|
@@ -10168,7 +10150,7 @@ def tanhshrink(input):
|
|
|
10168
10150
|
raise TypeError(f"For tanhshrink, the input must be a Tensor, but got {type(input)}.")
|
|
10169
10151
|
|
|
10170
10152
|
if input.dtype in mstype.int_type + mstype.uint_type:
|
|
10171
|
-
input = input.astype(mstype.
|
|
10153
|
+
input = input.astype(mstype.float64)
|
|
10172
10154
|
return input - tanh_(input)
|
|
10173
10155
|
|
|
10174
10156
|
|
|
@@ -11609,6 +11591,7 @@ __all__ = [
|
|
|
11609
11591
|
'addcdiv',
|
|
11610
11592
|
'addcmul',
|
|
11611
11593
|
'angle',
|
|
11594
|
+
'argmax',
|
|
11612
11595
|
'argmin',
|
|
11613
11596
|
'arccosh',
|
|
11614
11597
|
'arcsin',
|
|
@@ -11626,6 +11609,7 @@ __all__ = [
|
|
|
11626
11609
|
'le',
|
|
11627
11610
|
'lerp',
|
|
11628
11611
|
'norm',
|
|
11612
|
+
'norm_ext',
|
|
11629
11613
|
'vector_norm',
|
|
11630
11614
|
'matrix_norm',
|
|
11631
11615
|
'tensor_gt',
|
|
@@ -11695,6 +11679,7 @@ __all__ = [
|
|
|
11695
11679
|
'matrix_determinant',
|
|
11696
11680
|
'det',
|
|
11697
11681
|
'linspace',
|
|
11682
|
+
'linspace_ext',
|
|
11698
11683
|
'logspace',
|
|
11699
11684
|
'lu_solve',
|
|
11700
11685
|
'matrix_solve',
|
|
@@ -11782,6 +11767,7 @@ __all__ = [
|
|
|
11782
11767
|
'amin',
|
|
11783
11768
|
'amax',
|
|
11784
11769
|
'mean',
|
|
11770
|
+
'mean_ext',
|
|
11785
11771
|
'prod',
|
|
11786
11772
|
'all',
|
|
11787
11773
|
'any',
|