mindspore 2.5.0__cp310-cp310-win_amd64.whl → 2.6.0__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/__init__.py +6 -4
- mindspore/_c_dataengine.cp310-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp310-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp310-win_amd64.pyd +0 -0
- mindspore/_check_jit_forbidden_api.py +3 -0
- mindspore/_checkparam.py +3 -33
- mindspore/_deprecated/__init__.py +17 -0
- mindspore/_deprecated/jit.py +198 -0
- mindspore/_extends/builtin_operations.py +1 -1
- mindspore/_extends/parse/__init__.py +6 -7
- mindspore/_extends/parse/compile_config.py +19 -0
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +22 -3
- mindspore/_extends/parse/jit_fallback_modules/__init__.py +0 -0
- mindspore/_extends/parse/jit_fallback_modules/check_utils.py +123 -0
- mindspore/_extends/parse/jit_fallback_modules/third_party_modules.py +50 -0
- mindspore/_extends/parse/parser.py +25 -194
- mindspore/_extends/parse/resources.py +1 -5
- mindspore/_extends/parse/standard_method.py +109 -75
- mindspore/_extends/pijit/__init__.py +2 -2
- mindspore/_extends/pijit/pijit_func_white_list.py +16 -11
- mindspore/_extends/pijit/tensor_func_list.py +27 -0
- mindspore/_extends/utils.py +1 -1
- mindspore/amp.py +4 -4
- 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/__init__.py +2 -2
- mindspore/boost/base.py +3 -7
- mindspore/boost/boost_cell_wrapper.py +2 -2
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +4 -3
- mindspore/common/_grad_function.py +56 -0
- mindspore/common/_pijit_context.py +14 -5
- mindspore/common/_register_for_tensor.py +1 -1
- mindspore/common/_stub_tensor.py +5 -10
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +2014 -3386
- mindspore/common/api.py +386 -355
- mindspore/common/auto_dynamic_shape.py +41 -44
- mindspore/common/dtype.py +5 -2
- mindspore/common/dump.py +7 -5
- mindspore/common/file_system.py +3 -0
- mindspore/common/generator.py +3 -0
- mindspore/common/hook_handle.py +5 -3
- mindspore/common/initializer.py +10 -6
- mindspore/common/jit_begin_end.py +94 -0
- mindspore/common/jit_config.py +6 -1
- mindspore/common/jit_context.py +76 -0
- mindspore/common/jit_trace.py +378 -0
- mindspore/common/lazy_inline.py +2 -2
- mindspore/common/mutable.py +5 -4
- mindspore/common/parameter.py +106 -39
- mindspore/common/seed.py +2 -2
- mindspore/common/sparse_tensor.py +23 -17
- mindspore/common/tensor.py +332 -714
- mindspore/communication/__init__.py +7 -5
- mindspore/communication/_comm_helper.py +47 -2
- mindspore/communication/comm_func.py +70 -53
- mindspore/communication/management.py +83 -17
- mindspore/context.py +228 -571
- mindspore/dataset/__init__.py +44 -20
- mindspore/dataset/audio/__init__.py +2 -8
- mindspore/dataset/audio/transforms.py +3 -17
- mindspore/dataset/core/config.py +3 -3
- mindspore/dataset/engine/cache_client.py +1 -1
- mindspore/dataset/engine/datasets.py +102 -120
- mindspore/dataset/engine/datasets_audio.py +22 -22
- mindspore/dataset/engine/datasets_standard_format.py +43 -24
- mindspore/dataset/engine/datasets_text.py +78 -85
- mindspore/dataset/engine/datasets_user_defined.py +109 -77
- mindspore/dataset/engine/datasets_vision.py +111 -108
- mindspore/dataset/engine/iterators.py +5 -3
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +1 -1
- mindspore/dataset/engine/samplers.py +279 -57
- mindspore/dataset/engine/serializer_deserializer.py +2 -1
- mindspore/dataset/engine/validators.py +10 -0
- mindspore/dataset/text/__init__.py +7 -6
- mindspore/dataset/text/transforms.py +6 -5
- mindspore/dataset/text/utils.py +3 -3
- mindspore/dataset/transforms/__init__.py +0 -9
- mindspore/dataset/transforms/transforms.py +3 -3
- mindspore/dataset/utils/browse_dataset.py +1 -1
- mindspore/dataset/vision/__init__.py +2 -9
- mindspore/dataset/vision/transforms.py +202 -158
- mindspore/dataset/vision/utils.py +7 -5
- mindspore/device_context/ascend/op_debug.py +60 -1
- mindspore/device_context/ascend/op_tuning.py +0 -4
- mindspore/device_manager.py +39 -3
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/es/embedding_service.py +35 -27
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +0 -2
- mindspore/experimental/map_parameter.py +4 -4
- mindspore/experimental/optim/adadelta.py +22 -26
- mindspore/experimental/optim/adagrad.py +4 -4
- mindspore/experimental/optim/adam.py +4 -0
- mindspore/experimental/optim/adamax.py +4 -4
- mindspore/experimental/optim/adamw.py +4 -0
- mindspore/experimental/optim/asgd.py +1 -1
- mindspore/experimental/optim/lr_scheduler.py +40 -22
- mindspore/experimental/optim/radam.py +5 -5
- mindspore/experimental/optim/rprop.py +1 -1
- mindspore/experimental/optim/sgd.py +1 -1
- mindspore/hal/contiguous_tensors_handle.py +6 -10
- mindspore/hal/device.py +55 -81
- mindspore/hal/event.py +38 -55
- mindspore/hal/memory.py +115 -147
- mindspore/hal/stream.py +81 -125
- mindspore/include/dataset/constants.h +7 -4
- mindspore/include/dataset/execute.h +2 -2
- mindspore/jpeg62.dll +0 -0
- mindspore/log.py +40 -2
- mindspore/mindrecord/__init__.py +20 -7
- 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_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_backend.dll → 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 +133 -702
- mindspore/mint/distributed/__init__.py +5 -1
- mindspore/mint/distributed/distributed.py +198 -113
- mindspore/mint/linalg/__init__.py +2 -0
- mindspore/mint/nn/__init__.py +280 -18
- mindspore/mint/nn/functional.py +282 -64
- mindspore/mint/nn/layer/__init__.py +4 -0
- mindspore/mint/nn/layer/_functions.py +7 -3
- mindspore/mint/nn/layer/activation.py +120 -13
- mindspore/mint/nn/layer/conv.py +234 -28
- mindspore/mint/nn/layer/normalization.py +15 -16
- mindspore/mint/nn/layer/padding.py +1 -1
- mindspore/mint/nn/layer/pooling.py +66 -1
- mindspore/mint/optim/__init__.py +2 -1
- mindspore/mint/optim/sgd.py +171 -0
- 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/__init__.py +4 -1
- mindspore/nn/cell.py +1253 -179
- mindspore/nn/layer/activation.py +23 -21
- mindspore/nn/layer/basic.py +22 -16
- mindspore/nn/layer/container.py +1 -1
- mindspore/nn/layer/conv.py +53 -42
- mindspore/nn/layer/embedding.py +9 -8
- mindspore/nn/layer/normalization.py +48 -42
- mindspore/nn/layer/pooling.py +75 -31
- mindspore/nn/layer/transformer.py +11 -10
- mindspore/nn/learning_rate_schedule.py +4 -2
- mindspore/nn/loss/loss.py +27 -19
- mindspore/nn/optim/ada_grad.py +6 -5
- mindspore/nn/optim/adadelta.py +9 -7
- mindspore/nn/optim/adafactor.py +1 -1
- mindspore/nn/optim/adam.py +18 -14
- mindspore/nn/optim/adamax.py +8 -7
- mindspore/nn/optim/adasum.py +5 -5
- mindspore/nn/optim/asgd.py +3 -1
- mindspore/nn/optim/ftrl.py +11 -9
- mindspore/nn/optim/lamb.py +1 -1
- mindspore/nn/optim/lazyadam.py +12 -10
- mindspore/nn/optim/momentum.py +7 -6
- mindspore/nn/optim/optimizer.py +2 -2
- mindspore/nn/optim/proximal_ada_grad.py +12 -10
- mindspore/nn/optim/rmsprop.py +13 -12
- mindspore/nn/optim/rprop.py +9 -7
- mindspore/nn/optim/sgd.py +9 -6
- mindspore/nn/optim/tft_wrapper.py +5 -2
- mindspore/nn/probability/bijector/bijector.py +17 -11
- mindspore/nn/probability/bijector/gumbel_cdf.py +5 -5
- mindspore/nn/probability/bijector/invert.py +2 -2
- mindspore/nn/probability/bijector/scalar_affine.py +3 -3
- mindspore/nn/probability/bijector/softplus.py +3 -2
- mindspore/nn/probability/distribution/beta.py +3 -3
- mindspore/nn/probability/distribution/categorical.py +1 -1
- mindspore/nn/probability/distribution/cauchy.py +4 -2
- mindspore/nn/probability/distribution/exponential.py +6 -7
- mindspore/nn/probability/distribution/gamma.py +2 -2
- mindspore/nn/probability/distribution/gumbel.py +2 -2
- mindspore/nn/probability/distribution/half_normal.py +5 -3
- mindspore/nn/probability/distribution/logistic.py +5 -3
- mindspore/nn/probability/distribution/poisson.py +1 -1
- mindspore/nn/probability/distribution/uniform.py +5 -3
- mindspore/nn/reinforcement/_tensors_queue.py +1 -1
- mindspore/nn/reinforcement/tensor_array.py +1 -1
- mindspore/nn/wrap/__init__.py +6 -6
- mindspore/nn/wrap/cell_wrapper.py +178 -117
- mindspore/nn/wrap/grad_reducer.py +45 -36
- mindspore/nn/wrap/loss_scale.py +3 -3
- mindspore/numpy/array_creations.py +3 -3
- mindspore/numpy/array_ops.py +1 -1
- mindspore/numpy/utils.py +1 -2
- mindspore/numpy/utils_const.py +1 -2
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/__init__.py +3 -2
- mindspore/ops/_grad_experimental/grad_comm_ops.py +18 -3
- mindspore/ops/_grad_experimental/grad_debug_ops.py +8 -1
- mindspore/ops/_grad_experimental/taylor_rule.py +29 -0
- mindspore/ops/_register_for_op.py +0 -11
- mindspore/{ops_generate → ops/_utils}/arg_dtype_cast.py +123 -4
- mindspore/{ops_generate → ops/_utils}/arg_handler.py +3 -4
- mindspore/ops/_vmap/vmap_array_ops.py +32 -6
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +2 -1
- mindspore/ops/_vmap/vmap_math_ops.py +4 -7
- mindspore/ops/_vmap/vmap_nn_ops.py +9 -8
- mindspore/ops/auto_generate/__init__.py +4 -3
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +127 -52
- mindspore/ops/auto_generate/gen_extend_func.py +286 -208
- mindspore/ops/auto_generate/gen_ops_def.py +2783 -2335
- mindspore/ops/auto_generate/gen_ops_prim.py +8992 -2686
- mindspore/ops/auto_generate/pyboost_inner_prim.py +106 -76
- mindspore/ops/composite/__init__.py +2 -1
- mindspore/ops/composite/base.py +19 -24
- mindspore/ops/composite/math_ops.py +6 -16
- mindspore/ops/composite/multitype_ops/__init__.py +5 -2
- mindspore/ops/composite/multitype_ops/_compile_utils.py +4 -5
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -2
- mindspore/ops/composite/multitype_ops/add_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/div_impl.py +6 -4
- mindspore/ops/composite/multitype_ops/equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/getitem_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/greater_equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/greater_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/in_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/invert_impl.py +50 -0
- mindspore/ops/composite/multitype_ops/left_shift_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/less_equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/less_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/logic_not_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/logical_and_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/logical_or_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/mod_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/mul_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/negative_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/not_equal_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/not_in_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +18 -0
- mindspore/ops/composite/multitype_ops/pow_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/right_shift_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/setitem_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/sub_impl.py +2 -1
- mindspore/ops/function/__init__.py +28 -2
- mindspore/ops/function/_add_attr_func.py +58 -0
- mindspore/ops/function/array_func.py +1631 -2347
- mindspore/ops/function/clip_func.py +38 -45
- mindspore/ops/function/debug_func.py +36 -44
- mindspore/ops/function/grad/__init__.py +1 -0
- mindspore/ops/function/grad/grad_func.py +104 -71
- mindspore/ops/function/image_func.py +1 -1
- mindspore/ops/function/linalg_func.py +46 -78
- mindspore/ops/function/math_func.py +3024 -3855
- mindspore/ops/function/nn_func.py +678 -274
- mindspore/ops/function/other_func.py +159 -1
- mindspore/ops/function/parameter_func.py +17 -30
- mindspore/ops/function/random_func.py +216 -361
- mindspore/ops/function/reshard_func.py +4 -70
- mindspore/ops/function/sparse_func.py +3 -3
- mindspore/ops/function/sparse_unary_func.py +5 -5
- mindspore/ops/function/spectral_func.py +25 -58
- mindspore/ops/function/vmap_func.py +26 -18
- mindspore/ops/functional.py +8 -5
- mindspore/ops/functional_overload.py +655 -4
- mindspore/ops/op_info_register.py +32 -244
- mindspore/ops/operations/__init__.py +21 -14
- mindspore/ops/operations/_custom_ops_utils.py +235 -0
- mindspore/ops/operations/_grad_ops.py +1 -10
- mindspore/ops/operations/_inner_ops.py +5 -76
- mindspore/ops/operations/_ms_kernel.py +4 -10
- mindspore/ops/operations/_rl_inner_ops.py +1 -1
- mindspore/ops/operations/_scalar_ops.py +3 -2
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/_tensor_array.py +1 -1
- mindspore/ops/operations/array_ops.py +39 -24
- mindspore/ops/operations/comm_ops.py +150 -107
- mindspore/ops/operations/custom_ops.py +287 -32
- mindspore/ops/operations/debug_ops.py +119 -16
- mindspore/ops/operations/inner_ops.py +1 -1
- mindspore/ops/operations/linalg_ops.py +1 -58
- mindspore/ops/operations/manually_defined/_inner.py +1 -1
- mindspore/ops/operations/manually_defined/ops_def.py +746 -79
- mindspore/ops/operations/math_ops.py +21 -18
- mindspore/ops/operations/nn_ops.py +67 -224
- mindspore/ops/operations/other_ops.py +62 -9
- mindspore/ops/operations/random_ops.py +13 -7
- mindspore/ops/operations/reshard_ops.py +1 -1
- mindspore/ops/operations/sparse_ops.py +2 -2
- mindspore/ops/primitive.py +43 -32
- mindspore/ops/tensor_method.py +243 -17
- mindspore/ops_generate/__init__.py +0 -5
- mindspore/ops_generate/aclnn/__init__.py +0 -0
- mindspore/ops_generate/{aclnn_kernel_register_auto_cc_generator.py → aclnn/aclnn_kernel_register_auto_cc_generator.py} +43 -18
- mindspore/ops_generate/{gen_aclnn_implement.py → aclnn/gen_aclnn_implement.py} +49 -51
- mindspore/ops_generate/api/__init__.py +0 -0
- mindspore/ops_generate/{add_tensor_docs_generator.py → api/add_tensor_docs_generator.py} +9 -7
- mindspore/ops_generate/{cpp_create_prim_instance_helper_generator.py → api/cpp_create_prim_instance_helper_generator.py} +6 -9
- mindspore/ops_generate/{functional_map_cpp_generator.py → api/functional_map_cpp_generator.py} +25 -12
- mindspore/ops_generate/{functional_overload_py_generator.py → api/functional_overload_py_generator.py} +8 -6
- mindspore/ops_generate/{functions_cc_generator.py → api/functions_cc_generator.py} +14 -10
- mindspore/ops_generate/api/gen_api.py +103 -0
- mindspore/ops_generate/{op_api_proto.py → api/op_api_proto.py} +98 -69
- mindspore/ops_generate/{tensor_func_reg_cpp_generator.py → api/tensor_func_reg_cpp_generator.py} +82 -43
- mindspore/ops_generate/common/__init__.py +0 -0
- mindspore/ops_generate/common/gen_constants.py +91 -0
- mindspore/ops_generate/{gen_utils.py → common/gen_utils.py} +72 -19
- mindspore/ops_generate/{op_proto.py → common/op_proto.py} +64 -1
- mindspore/ops_generate/{template.py → common/template.py} +96 -84
- mindspore/ops_generate/gen_ops.py +23 -325
- mindspore/ops_generate/op_def/__init__.py +0 -0
- mindspore/ops_generate/op_def/gen_op_def.py +90 -0
- mindspore/ops_generate/{lite_ops_cpp_generator.py → op_def/lite_ops_cpp_generator.py} +47 -11
- mindspore/ops_generate/{ops_def_cc_generator.py → op_def/ops_def_cc_generator.py} +18 -10
- mindspore/ops_generate/{ops_def_h_generator.py → op_def/ops_def_h_generator.py} +5 -5
- mindspore/ops_generate/{ops_name_h_generator.py → op_def/ops_name_h_generator.py} +30 -15
- mindspore/ops_generate/op_def/ops_primitive_h_generator.py +125 -0
- mindspore/ops_generate/op_def_py/__init__.py +0 -0
- mindspore/ops_generate/op_def_py/gen_op_def_py.py +47 -0
- mindspore/ops_generate/{op_def_py_generator.py → op_def_py/op_def_py_generator.py} +6 -5
- mindspore/ops_generate/{op_prim_py_generator.py → op_def_py/op_prim_py_generator.py} +24 -15
- mindspore/ops_generate/pyboost/__init__.py +0 -0
- mindspore/ops_generate/{auto_grad_impl_cc_generator.py → pyboost/auto_grad_impl_cc_generator.py} +11 -7
- mindspore/ops_generate/{auto_grad_reg_cc_generator.py → pyboost/auto_grad_reg_cc_generator.py} +7 -7
- mindspore/ops_generate/{gen_pyboost_func.py → pyboost/gen_pyboost_func.py} +40 -16
- mindspore/ops_generate/{op_template_parser.py → pyboost/op_template_parser.py} +105 -24
- mindspore/ops_generate/{pyboost_functions_cpp_generator.py → pyboost/pyboost_functions_cpp_generator.py} +55 -18
- mindspore/ops_generate/{pyboost_functions_h_generator.py → pyboost/pyboost_functions_h_generator.py} +42 -10
- mindspore/ops_generate/{pyboost_functions_py_generator.py → pyboost/pyboost_functions_py_generator.py} +6 -6
- mindspore/ops_generate/{pyboost_grad_function_cpp_generator.py → pyboost/pyboost_grad_function_cpp_generator.py} +11 -10
- mindspore/ops_generate/{pyboost_inner_prim_generator.py → pyboost/pyboost_inner_prim_generator.py} +8 -7
- mindspore/ops_generate/{pyboost_native_grad_functions_generator.py → pyboost/pyboost_native_grad_functions_generator.py} +14 -10
- mindspore/ops_generate/{pyboost_op_cpp_code_generator.py → pyboost/pyboost_op_cpp_code_generator.py} +140 -53
- mindspore/ops_generate/{pyboost_overload_functions_cpp_generator.py → pyboost/pyboost_overload_functions_cpp_generator.py} +28 -15
- mindspore/ops_generate/{pyboost_utils.py → pyboost/pyboost_utils.py} +88 -4
- mindspore/ops_generate/resources/__init__.py +0 -0
- mindspore/ops_generate/resources/resource_list.py +30 -0
- mindspore/ops_generate/resources/resource_loader.py +36 -0
- mindspore/ops_generate/resources/resource_manager.py +64 -0
- mindspore/ops_generate/resources/yaml_loader.py +88 -0
- mindspore/ops_generate/tensor_py_cc_generator.py +122 -0
- mindspore/parallel/__init__.py +6 -2
- mindspore/parallel/_auto_parallel_context.py +140 -12
- mindspore/parallel/_cell_wrapper.py +132 -15
- mindspore/parallel/_parallel_serialization.py +95 -4
- mindspore/parallel/_ps_context.py +1 -1
- mindspore/parallel/_recovery_context.py +7 -2
- mindspore/parallel/_tensor.py +142 -18
- mindspore/parallel/_utils.py +198 -25
- mindspore/parallel/algo_parameter_config.py +3 -3
- mindspore/parallel/auto_parallel.py +732 -0
- mindspore/parallel/checkpoint_convert.py +159 -0
- mindspore/parallel/checkpoint_transform.py +658 -37
- mindspore/parallel/cluster/process_entity/_api.py +151 -19
- mindspore/parallel/cluster/run.py +1 -1
- mindspore/parallel/function/__init__.py +24 -0
- mindspore/parallel/function/reshard_func.py +258 -0
- mindspore/parallel/nn/__init__.py +25 -0
- mindspore/parallel/nn/parallel_cell_wrapper.py +263 -0
- mindspore/parallel/nn/parallel_grad_reducer.py +169 -0
- mindspore/parallel/parameter_broadcast.py +24 -13
- mindspore/parallel/shard.py +137 -62
- mindspore/parallel/transform_safetensors.py +288 -95
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +9 -5
- mindspore/profiler/analysis/parser/ascend_cann_parser.py +6 -2
- mindspore/profiler/analysis/parser/ms_framework_parser.py +4 -4
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -4
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +25 -0
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +241 -86
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +41 -2
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +33 -35
- mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +7 -0
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +8 -3
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +141 -30
- mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +5 -6
- mindspore/profiler/common/ascend_msprof_exporter.py +5 -4
- mindspore/profiler/common/constant.py +12 -0
- mindspore/profiler/common/msprof_cmd_tool.py +42 -23
- mindspore/profiler/common/path_manager.py +24 -0
- mindspore/profiler/common/profiler_context.py +26 -2
- mindspore/profiler/common/profiler_meta_data.py +74 -0
- mindspore/profiler/common/profiler_parameters.py +59 -18
- mindspore/profiler/common/profiler_path_manager.py +66 -7
- mindspore/profiler/dynamic_profiler.py +112 -79
- mindspore/profiler/envprofiler.py +26 -1
- mindspore/profiler/experimental_config.py +197 -0
- mindspore/profiler/mstx.py +57 -14
- mindspore/profiler/platform/npu_profiler.py +33 -7
- mindspore/profiler/profiler.py +541 -45
- mindspore/profiler/profiler_action_controller.py +1 -1
- mindspore/profiler/profiler_interface.py +4 -0
- mindspore/profiler/schedule.py +57 -22
- mindspore/rewrite/api/node.py +15 -13
- mindspore/rewrite/api/symbol_tree.py +1 -1
- mindspore/run_check/_check_version.py +25 -14
- mindspore/run_check/run_check.py +1 -1
- mindspore/runtime/__init__.py +2 -2
- mindspore/runtime/executor.py +40 -11
- mindspore/runtime/memory.py +37 -13
- mindspore/safeguard/rewrite_obfuscation.py +12 -9
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/__init__.py +8 -8
- mindspore/train/_utils.py +43 -9
- mindspore/train/amp.py +1 -1
- mindspore/train/callback/__init__.py +2 -2
- mindspore/train/callback/_callback.py +2 -16
- mindspore/train/callback/_checkpoint.py +24 -40
- mindspore/train/callback/_cluster_monitor.py +14 -18
- mindspore/train/callback/_flops_collector.py +2 -3
- mindspore/train/callback/_history.py +7 -4
- mindspore/train/callback/_lambda_callback.py +2 -2
- mindspore/train/callback/_landscape.py +0 -3
- mindspore/train/callback/_loss_monitor.py +2 -1
- mindspore/train/callback/_on_request_exit.py +6 -5
- mindspore/train/callback/_reduce_lr_on_plateau.py +11 -6
- mindspore/train/callback/_summary_collector.py +8 -13
- mindspore/train/callback/_time_monitor.py +2 -1
- mindspore/train/callback/{_tft_register.py → _train_fault_tolerance.py} +204 -105
- mindspore/train/data_sink.py +25 -2
- mindspore/train/dataset_helper.py +4 -5
- mindspore/train/loss_scale_manager.py +8 -7
- mindspore/train/metrics/accuracy.py +3 -3
- mindspore/train/metrics/confusion_matrix.py +9 -9
- mindspore/train/metrics/error.py +3 -3
- mindspore/train/metrics/hausdorff_distance.py +4 -4
- mindspore/train/metrics/mean_surface_distance.py +3 -3
- mindspore/train/metrics/metric.py +0 -12
- mindspore/train/metrics/occlusion_sensitivity.py +4 -2
- mindspore/train/metrics/precision.py +8 -6
- mindspore/train/metrics/recall.py +9 -9
- mindspore/train/metrics/root_mean_square_surface_distance.py +2 -2
- mindspore/train/mind_ir_pb2.py +19 -12
- mindspore/train/model.py +262 -127
- mindspore/train/serialization.py +246 -988
- mindspore/train/summary/_summary_adapter.py +2 -2
- mindspore/train/summary/summary_record.py +1 -1
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +3 -2
- mindspore/utils/dryrun.py +4 -2
- mindspore/utils/hooks.py +81 -0
- mindspore/utils/runtime_execution_order_check.py +2 -0
- mindspore/utils/utils.py +138 -4
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/METADATA +2 -1
- {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/RECORD +485 -440
- mindspore/_install_custom.py +0 -43
- mindspore/common/_register_for_adapter.py +0 -74
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +0 -252
- mindspore/ops/auto_generate/gen_arg_handler.py +0 -136
- mindspore/ops/operations/_opaque_predicate_registry.py +0 -41
- mindspore/ops_generate/gen_constants.py +0 -190
- mindspore/ops_generate/gen_ops_inner_prim.py +0 -131
- mindspore/ops_generate/ops_primitive_h_generator.py +0 -81
- /mindspore/ops_generate/{base_generator.py → common/base_generator.py} +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/WHEEL +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/entry_points.txt +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/top_level.txt +0 -0
|
@@ -125,12 +125,12 @@ class AdjustBrightness(ImageTensorOperation, PyTensorOperation):
|
|
|
125
125
|
|
|
126
126
|
Args:
|
|
127
127
|
brightness_factor (float): How much to adjust the brightness, must be non negative.
|
|
128
|
-
``0`` gives a black image, ``1`` gives the original image,
|
|
129
|
-
while ``2`` increases the brightness by a factor of 2.
|
|
128
|
+
``0.0`` gives a black image, ``1.0`` gives the original image,
|
|
129
|
+
while ``2.0`` increases the brightness by a factor of 2.
|
|
130
130
|
|
|
131
131
|
Raises:
|
|
132
132
|
TypeError: If `brightness_factor` is not of type float.
|
|
133
|
-
ValueError: If `brightness_factor` is less than 0.
|
|
133
|
+
ValueError: If `brightness_factor` is less than ``0.0``.
|
|
134
134
|
RuntimeError: If shape of the input image is not <H, W, C>.
|
|
135
135
|
|
|
136
136
|
Supported Platforms:
|
|
@@ -173,15 +173,15 @@ class AdjustBrightness(ImageTensorOperation, PyTensorOperation):
|
|
|
173
173
|
"""
|
|
174
174
|
Set the device for the current operator execution.
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
When the device is Ascend, input shape should be limited from [4, 6] to [8192, 4096].
|
|
177
177
|
|
|
178
178
|
Args:
|
|
179
179
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
180
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
180
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
181
181
|
|
|
182
182
|
Raises:
|
|
183
183
|
TypeError: If `device_target` is not of type str.
|
|
184
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
184
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
185
185
|
|
|
186
186
|
Supported Platforms:
|
|
187
187
|
``CPU`` ``Ascend``
|
|
@@ -239,12 +239,12 @@ class AdjustContrast(ImageTensorOperation, PyTensorOperation):
|
|
|
239
239
|
|
|
240
240
|
Args:
|
|
241
241
|
contrast_factor (float): How much to adjust the contrast, must be non negative.
|
|
242
|
-
``0`` gives a solid gray image, ``1`` gives the original image,
|
|
243
|
-
while ``2`` increases the contrast by a factor of 2.
|
|
242
|
+
``0.0`` gives a solid gray image, ``1.0`` gives the original image,
|
|
243
|
+
while ``2.0`` increases the contrast by a factor of 2.
|
|
244
244
|
|
|
245
245
|
Raises:
|
|
246
246
|
TypeError: If `contrast_factor` is not of type float.
|
|
247
|
-
ValueError: If `contrast_factor` is less than 0.
|
|
247
|
+
ValueError: If `contrast_factor` is less than ``0.0``.
|
|
248
248
|
RuntimeError: If shape of the input image is not <H, W, C>.
|
|
249
249
|
|
|
250
250
|
Supported Platforms:
|
|
@@ -286,15 +286,15 @@ class AdjustContrast(ImageTensorOperation, PyTensorOperation):
|
|
|
286
286
|
"""
|
|
287
287
|
Set the device for the current operator execution.
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
When the device is Ascend, input shape should be limited from [4, 6] to [8192, 4096].
|
|
290
290
|
|
|
291
291
|
Args:
|
|
292
292
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
293
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
293
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
294
294
|
|
|
295
295
|
Raises:
|
|
296
296
|
TypeError: If `device_target` is not of type str.
|
|
297
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
297
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
298
298
|
|
|
299
299
|
Supported Platforms:
|
|
300
300
|
``CPU`` ``Ascend``
|
|
@@ -357,14 +357,14 @@ class AdjustGamma(ImageTensorOperation, PyTensorOperation):
|
|
|
357
357
|
Args:
|
|
358
358
|
gamma (float): Non negative real number.
|
|
359
359
|
The output image pixel value is exponentially related to the input image pixel value.
|
|
360
|
-
gamma larger than 1 make the shadows darker,
|
|
361
|
-
while gamma smaller than 1 make dark regions lighter.
|
|
360
|
+
gamma larger than ``1.0`` make the shadows darker,
|
|
361
|
+
while gamma smaller than ``1.0`` make dark regions lighter.
|
|
362
362
|
gain (float, optional): The constant multiplier. Default: ``1.0``.
|
|
363
363
|
|
|
364
364
|
Raises:
|
|
365
365
|
TypeError: If `gain` is not of type float.
|
|
366
366
|
TypeError: If `gamma` is not of type float.
|
|
367
|
-
ValueError: If `gamma` is less than 0.
|
|
367
|
+
ValueError: If `gamma` is less than ``0.0``.
|
|
368
368
|
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
369
369
|
|
|
370
370
|
Supported Platforms:
|
|
@@ -473,15 +473,15 @@ class AdjustHue(ImageTensorOperation, PyTensorOperation):
|
|
|
473
473
|
"""
|
|
474
474
|
Set the device for the current operator execution.
|
|
475
475
|
|
|
476
|
-
|
|
476
|
+
When the device is Ascend, input shape should be limited from [4, 6] to [8192, 4096].
|
|
477
477
|
|
|
478
478
|
Args:
|
|
479
479
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
480
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
480
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
481
481
|
|
|
482
482
|
Raises:
|
|
483
483
|
TypeError: If `device_target` is not of type str.
|
|
484
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
484
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
485
485
|
|
|
486
486
|
Supported Platforms:
|
|
487
487
|
``CPU`` ``Ascend``
|
|
@@ -538,12 +538,12 @@ class AdjustSaturation(ImageTensorOperation, PyTensorOperation):
|
|
|
538
538
|
|
|
539
539
|
Args:
|
|
540
540
|
saturation_factor (float): How much to adjust the saturation, must be non negative.
|
|
541
|
-
``0`` gives a black image, ``1`` gives the original image
|
|
542
|
-
while ``2`` increases the saturation by a factor of 2.
|
|
541
|
+
``0.0`` gives a black image, ``1.0`` gives the original image
|
|
542
|
+
while ``2.0`` increases the saturation by a factor of 2.
|
|
543
543
|
|
|
544
544
|
Raises:
|
|
545
545
|
TypeError: If `saturation_factor` is not of type float.
|
|
546
|
-
ValueError: If `saturation_factor` is less than 0.
|
|
546
|
+
ValueError: If `saturation_factor` is less than ``0.0``.
|
|
547
547
|
RuntimeError: If shape of the input image is not <H, W, C>.
|
|
548
548
|
RuntimeError: If channel of the input image is not 3.
|
|
549
549
|
|
|
@@ -586,15 +586,15 @@ class AdjustSaturation(ImageTensorOperation, PyTensorOperation):
|
|
|
586
586
|
"""
|
|
587
587
|
Set the device for the current operator execution.
|
|
588
588
|
|
|
589
|
-
|
|
589
|
+
When the device is Ascend, input shape should be limited from [4, 6] to [8192, 4096].
|
|
590
590
|
|
|
591
591
|
Args:
|
|
592
592
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
593
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
593
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
594
594
|
|
|
595
595
|
Raises:
|
|
596
596
|
TypeError: If `device_target` is not of type str.
|
|
597
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
597
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
598
598
|
|
|
599
599
|
Supported Platforms:
|
|
600
600
|
``CPU`` ``Ascend``
|
|
@@ -651,12 +651,12 @@ class AdjustSharpness(ImageTensorOperation):
|
|
|
651
651
|
|
|
652
652
|
Args:
|
|
653
653
|
sharpness_factor (float): How much to adjust the sharpness, must be
|
|
654
|
-
non negative. ``0`` gives a blurred image, ``1`` gives the
|
|
655
|
-
original image while ``2`` increases the sharpness by a factor of 2.
|
|
654
|
+
non negative. ``0.0`` gives a blurred image, ``1.0`` gives the
|
|
655
|
+
original image while ``2.0`` increases the sharpness by a factor of 2.
|
|
656
656
|
|
|
657
657
|
Raises:
|
|
658
658
|
TypeError: If `sharpness_factor` is not of type float.
|
|
659
|
-
ValueError: If `sharpness_factor` is less than 0.
|
|
659
|
+
ValueError: If `sharpness_factor` is less than ``0.0``.
|
|
660
660
|
RuntimeError: If shape of the input image is not <H, W> or <H, W, C>.
|
|
661
661
|
|
|
662
662
|
Supported Platforms:
|
|
@@ -700,16 +700,16 @@ class AdjustSharpness(ImageTensorOperation):
|
|
|
700
700
|
"""
|
|
701
701
|
Set the device for the current operator execution.
|
|
702
702
|
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
When the device is Ascend, input type supports `uint8` or `float32` , input channel supports 1 and 3.
|
|
704
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
705
705
|
|
|
706
706
|
Args:
|
|
707
707
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
708
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
708
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
709
709
|
|
|
710
710
|
Raises:
|
|
711
711
|
TypeError: If `device_target` is not of type str.
|
|
712
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
712
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
713
713
|
|
|
714
714
|
Supported Platforms:
|
|
715
715
|
``CPU`` ``Ascend``
|
|
@@ -754,13 +754,15 @@ class Affine(ImageTensorOperation):
|
|
|
754
754
|
Supports Ascend hardware acceleration and can be enabled through the `.device("Ascend")` method.
|
|
755
755
|
|
|
756
756
|
Args:
|
|
757
|
-
degrees (float): Rotation angle in degrees between
|
|
757
|
+
degrees (float): Rotation angle in degrees between ``-180`` and ``180``, clockwise direction.
|
|
758
758
|
translate (Sequence[float, float]): The horizontal and vertical translations, must be a sequence of size 2
|
|
759
|
-
and value between
|
|
759
|
+
and value between ``-1.0`` and ``1.0``.
|
|
760
760
|
scale (float): Scaling factor, which must be positive.
|
|
761
|
-
shear (Union[float, Sequence[float, float]]): Shear angle value in degrees between
|
|
762
|
-
|
|
763
|
-
If
|
|
761
|
+
shear (Union[float, Sequence[float, float]]): Shear angle value in degrees between ``-180`` to ``180``.
|
|
762
|
+
|
|
763
|
+
- If float is provided, shear along the x axis with this value, without shearing along the y axis;
|
|
764
|
+
- If Sequence[float, float] is provided, shear along the x axis and y axis with these two values separately.
|
|
765
|
+
|
|
764
766
|
resample (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
765
767
|
Default: ``Inter.NEAREST``.
|
|
766
768
|
fill_value (Union[int, tuple[int, int, int]], optional): Optional `fill_value` to fill the area
|
|
@@ -832,15 +834,15 @@ class Affine(ImageTensorOperation):
|
|
|
832
834
|
"""
|
|
833
835
|
Set the device for the current operator execution.
|
|
834
836
|
|
|
835
|
-
|
|
837
|
+
When the device is Ascend, input shape should be limited from [4, 6] to [32768, 32768].
|
|
836
838
|
|
|
837
839
|
Args:
|
|
838
840
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
839
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
841
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
840
842
|
|
|
841
843
|
Raises:
|
|
842
844
|
TypeError: If `device_target` is not of type str.
|
|
843
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
845
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
844
846
|
|
|
845
847
|
Supported Platforms:
|
|
846
848
|
``CPU`` ``Ascend``
|
|
@@ -904,9 +906,10 @@ class AutoAugment(ImageTensorOperation):
|
|
|
904
906
|
interpolation (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
905
907
|
Default: ``Inter.NEAREST``.
|
|
906
908
|
fill_value (Union[int, tuple[int]], optional): Pixel fill value for the area outside the transformed image.
|
|
907
|
-
It can be an int or a 3-tuple.
|
|
908
|
-
|
|
909
|
-
|
|
909
|
+
It can be an int or a 3-tuple. Default: ``0``.
|
|
910
|
+
|
|
911
|
+
- If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
912
|
+
- If it is an integer, it is used for all RGB channels. The fill_value values must be in range [0, 255].
|
|
910
913
|
|
|
911
914
|
Raises:
|
|
912
915
|
TypeError: If `policy` is not of type :class:`mindspore.dataset.vision.AutoAugmentPolicy` .
|
|
@@ -963,7 +966,8 @@ class AutoAugment(ImageTensorOperation):
|
|
|
963
966
|
|
|
964
967
|
class AutoContrast(ImageTensorOperation, PyTensorOperation):
|
|
965
968
|
"""
|
|
966
|
-
|
|
969
|
+
Automatically adjusts the contrast on the input image. This operation calculates histogram of image,
|
|
970
|
+
reassign cutoff percent
|
|
967
971
|
of the lightest pixels from histogram to 255, and reassign cutoff percent of the darkest pixels from histogram to 0.
|
|
968
972
|
|
|
969
973
|
Supports Ascend hardware acceleration and can be enabled through the `.device("Ascend")` method.
|
|
@@ -977,7 +981,7 @@ class AutoContrast(ImageTensorOperation, PyTensorOperation):
|
|
|
977
981
|
Raises:
|
|
978
982
|
TypeError: If `cutoff` is not of type float.
|
|
979
983
|
TypeError: If `ignore` is not of type int or sequence.
|
|
980
|
-
ValueError: If `cutoff` is not in range [0, 50.0).
|
|
984
|
+
ValueError: If `cutoff` is not in range [0.0, 50.0).
|
|
981
985
|
ValueError: If `ignore` is not in range [0, 255].
|
|
982
986
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
983
987
|
|
|
@@ -1026,17 +1030,17 @@ class AutoContrast(ImageTensorOperation, PyTensorOperation):
|
|
|
1026
1030
|
"""
|
|
1027
1031
|
Set the device for the current operator execution.
|
|
1028
1032
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1033
|
+
When the device is Ascend, input type supports `uint8` or `float32` , input channel supports 1 and 3.
|
|
1034
|
+
If the data type is float32, the expected input value is in the range [0, 1].
|
|
1035
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
1032
1036
|
|
|
1033
1037
|
Args:
|
|
1034
1038
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
1035
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
1039
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
1036
1040
|
|
|
1037
1041
|
Raises:
|
|
1038
1042
|
TypeError: If `device_target` is not of type str.
|
|
1039
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
1043
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
1040
1044
|
|
|
1041
1045
|
Supported Platforms:
|
|
1042
1046
|
``CPU`` ``Ascend``
|
|
@@ -1343,16 +1347,16 @@ class ConvertColor(ImageTensorOperation):
|
|
|
1343
1347
|
"""
|
|
1344
1348
|
Set the device for the current operator execution.
|
|
1345
1349
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1350
|
+
When the device is Ascend, input type only supports `uint8` , input channel supports 1 and 3.
|
|
1351
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
1348
1352
|
|
|
1349
1353
|
Args:
|
|
1350
1354
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
1351
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
1355
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
1352
1356
|
|
|
1353
1357
|
Raises:
|
|
1354
1358
|
TypeError: If `device_target` is not of type str.
|
|
1355
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
1359
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
1356
1360
|
|
|
1357
1361
|
Supported Platforms:
|
|
1358
1362
|
``CPU`` ``Ascend``
|
|
@@ -1399,8 +1403,10 @@ class Crop(ImageTensorOperation):
|
|
|
1399
1403
|
coordinates(sequence): Coordinates of the upper left corner of the cropping image. Must be a sequence of two
|
|
1400
1404
|
values, in the form of (top, left).
|
|
1401
1405
|
size (Union[int, sequence]): The output size of the cropped image.
|
|
1402
|
-
|
|
1403
|
-
If size is
|
|
1406
|
+
|
|
1407
|
+
- If size is an integer, a square crop of size (size, size) is returned.
|
|
1408
|
+
- If size is a sequence of length 2, it should be (height, width).
|
|
1409
|
+
|
|
1404
1410
|
The size value(s) must be larger than 0.
|
|
1405
1411
|
|
|
1406
1412
|
Raises:
|
|
@@ -1454,15 +1460,15 @@ class Crop(ImageTensorOperation):
|
|
|
1454
1460
|
"""
|
|
1455
1461
|
Set the device for the current operator execution.
|
|
1456
1462
|
|
|
1457
|
-
|
|
1463
|
+
When the device is Ascend, input/output shape should be limited from [4, 6] to [32768, 32768].
|
|
1458
1464
|
|
|
1459
1465
|
Args:
|
|
1460
1466
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
1461
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
1467
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
1462
1468
|
|
|
1463
1469
|
Raises:
|
|
1464
1470
|
TypeError: If `device_target` is not of type str.
|
|
1465
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
1471
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
1466
1472
|
|
|
1467
1473
|
Supported Platforms:
|
|
1468
1474
|
``CPU`` ``Ascend``
|
|
@@ -1735,13 +1741,15 @@ class Decode(ImageTensorOperation, PyTensorOperation):
|
|
|
1735
1741
|
"""
|
|
1736
1742
|
Set the device for the current operator execution.
|
|
1737
1743
|
|
|
1744
|
+
When the device is Ascend, input type only supports `uint8`.
|
|
1745
|
+
|
|
1738
1746
|
Args:
|
|
1739
1747
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
1740
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
1748
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
1741
1749
|
|
|
1742
1750
|
Raises:
|
|
1743
1751
|
TypeError: If `device_target` is not of type str.
|
|
1744
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
1752
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
1745
1753
|
|
|
1746
1754
|
Supported Platforms:
|
|
1747
1755
|
``CPU`` ``Ascend``
|
|
@@ -1918,16 +1926,16 @@ class Equalize(ImageTensorOperation, PyTensorOperation):
|
|
|
1918
1926
|
"""
|
|
1919
1927
|
Set the device for the current operator execution.
|
|
1920
1928
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1929
|
+
When the device is Ascend, input type only supports `uint8` , input channel supports 1 and 3.
|
|
1930
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
1923
1931
|
|
|
1924
1932
|
Args:
|
|
1925
1933
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
1926
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
1934
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
1927
1935
|
|
|
1928
1936
|
Raises:
|
|
1929
1937
|
TypeError: If `device_target` is not of type str.
|
|
1930
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
1938
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
1931
1939
|
|
|
1932
1940
|
Supported Platforms:
|
|
1933
1941
|
``CPU`` ``Ascend``
|
|
@@ -1979,7 +1987,7 @@ class Equalize(ImageTensorOperation, PyTensorOperation):
|
|
|
1979
1987
|
|
|
1980
1988
|
class Erase(ImageTensorOperation):
|
|
1981
1989
|
"""
|
|
1982
|
-
Erase the input image with
|
|
1990
|
+
Erase a specified area of the input image and fills it with the specified pixel value `value`.
|
|
1983
1991
|
|
|
1984
1992
|
Supports Ascend hardware acceleration and can be enabled through the `.device("Ascend")` method.
|
|
1985
1993
|
|
|
@@ -1989,8 +1997,11 @@ class Erase(ImageTensorOperation):
|
|
|
1989
1997
|
height (int): Height of erased region.
|
|
1990
1998
|
width (int): Width of erased region.
|
|
1991
1999
|
value (Union[float, Sequence[float, float, float]], optional): Pixel value used to pad the erased area.
|
|
1992
|
-
Default: ``0``.
|
|
1993
|
-
|
|
2000
|
+
Default: ``0.0``.
|
|
2001
|
+
|
|
2002
|
+
- If float is provided, it will be used for all RGB channels.
|
|
2003
|
+
- If Sequence[float, float, float] is provided, it will be used for R, G, B channels respectively.
|
|
2004
|
+
|
|
1994
2005
|
inplace (bool, optional): Whether to apply erasing inplace. Default: ``False``.
|
|
1995
2006
|
|
|
1996
2007
|
Raises:
|
|
@@ -2037,7 +2048,7 @@ class Erase(ImageTensorOperation):
|
|
|
2037
2048
|
"""
|
|
2038
2049
|
|
|
2039
2050
|
@check_erase
|
|
2040
|
-
def __init__(self, top, left, height, width, value=0, inplace=False):
|
|
2051
|
+
def __init__(self, top, left, height, width, value=0.0, inplace=False):
|
|
2041
2052
|
super().__init__()
|
|
2042
2053
|
self.top = top
|
|
2043
2054
|
self.left = left
|
|
@@ -2053,17 +2064,17 @@ class Erase(ImageTensorOperation):
|
|
|
2053
2064
|
"""
|
|
2054
2065
|
Set the device for the current operator execution.
|
|
2055
2066
|
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2067
|
+
When the device is Ascend, input type supports `uint8` or `float32` , input channel supports 1 and 3.
|
|
2068
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
2069
|
+
The inplace parameter is not supported.
|
|
2059
2070
|
|
|
2060
2071
|
Args:
|
|
2061
2072
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
2062
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
2073
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
2063
2074
|
|
|
2064
2075
|
Raises:
|
|
2065
2076
|
TypeError: If `device_target` is not of type str.
|
|
2066
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
2077
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
2067
2078
|
|
|
2068
2079
|
Supported Platforms:
|
|
2069
2080
|
``CPU`` ``Ascend``
|
|
@@ -2203,15 +2214,19 @@ class GaussianBlur(ImageTensorOperation):
|
|
|
2203
2214
|
|
|
2204
2215
|
Args:
|
|
2205
2216
|
kernel_size (Union[int, Sequence[int, int]]): The size of the Gaussian kernel. Must be positive and odd.
|
|
2206
|
-
|
|
2207
|
-
If the input type is
|
|
2208
|
-
|
|
2217
|
+
|
|
2218
|
+
- If the input type is int, the value will be used as both the width and height of the Gaussian kernel.
|
|
2219
|
+
- If the input type is Sequence[int, int], the two elements will be used as the width and height of the
|
|
2220
|
+
Gaussian kernel respectively.
|
|
2221
|
+
|
|
2209
2222
|
sigma (Union[float, Sequence[float, float]], optional): The standard deviation of the Gaussian kernel.
|
|
2210
2223
|
Must be positive.
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2224
|
+
|
|
2225
|
+
- If the input type is float, the value will be used as the standard deviation of both the width and
|
|
2226
|
+
height of the Gaussian kernel.
|
|
2227
|
+
- If the input type is Sequence[float, float], the two elements will be used as the standard deviation
|
|
2228
|
+
of the width and height of the Gaussian kernel respectively.
|
|
2229
|
+
|
|
2215
2230
|
Default: ``None`` , the standard deviation of the Gaussian kernel will be obtained by the
|
|
2216
2231
|
formula :math:`((kernel\_size - 1) * 0.5 - 1) * 0.3 + 0.8` .
|
|
2217
2232
|
|
|
@@ -2269,16 +2284,16 @@ class GaussianBlur(ImageTensorOperation):
|
|
|
2269
2284
|
"""
|
|
2270
2285
|
Set the device for the current operator execution.
|
|
2271
2286
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2287
|
+
When the device is Ascend, the parameter `kernel_size` only supports values 1, 3, and 5.
|
|
2288
|
+
input shape should be limited from [4, 6] to [8192, 4096].
|
|
2274
2289
|
|
|
2275
2290
|
Args:
|
|
2276
2291
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
2277
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
2292
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
2278
2293
|
|
|
2279
2294
|
Raises:
|
|
2280
2295
|
TypeError: If `device_target` is not of type str.
|
|
2281
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
2296
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
2282
2297
|
|
|
2283
2298
|
Supported Platforms:
|
|
2284
2299
|
``CPU`` ``Ascend``
|
|
@@ -2456,17 +2471,17 @@ class HorizontalFlip(ImageTensorOperation):
|
|
|
2456
2471
|
"""
|
|
2457
2472
|
Set the device for the current operator execution.
|
|
2458
2473
|
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2474
|
+
When the device is Ascend, input type supports `uint8` and `float32`,
|
|
2475
|
+
input channel supports 1 and 3. The input data has a height limit of [4, 8192]
|
|
2476
|
+
and a width limit of [6, 4096].
|
|
2462
2477
|
|
|
2463
2478
|
Args:
|
|
2464
2479
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
2465
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
2480
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
2466
2481
|
|
|
2467
2482
|
Raises:
|
|
2468
2483
|
TypeError: If `device_target` is not of type str.
|
|
2469
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
2484
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
2470
2485
|
|
|
2471
2486
|
Supported Platforms:
|
|
2472
2487
|
``CPU`` ``Ascend``
|
|
@@ -2670,9 +2685,8 @@ class Invert(ImageTensorOperation, PyTensorOperation):
|
|
|
2670
2685
|
"""
|
|
2671
2686
|
Set the device for the current operator execution.
|
|
2672
2687
|
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
input shape should be limited from [4, 6] to [8192, 4096].
|
|
2688
|
+
When the device is Ascend, input type supports `uint8`/`float32`, input channel supports 1/3.
|
|
2689
|
+
input shape should be limited from [4, 6] to [8192, 4096].
|
|
2676
2690
|
|
|
2677
2691
|
Args:
|
|
2678
2692
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
@@ -3057,11 +3071,11 @@ class Normalize(ImageTensorOperation):
|
|
|
3057
3071
|
|
|
3058
3072
|
Args:
|
|
3059
3073
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
3060
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
3074
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
3061
3075
|
|
|
3062
3076
|
Raises:
|
|
3063
3077
|
TypeError: If `device_target` is not of type str.
|
|
3064
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
3078
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
3065
3079
|
|
|
3066
3080
|
Supported Platforms:
|
|
3067
3081
|
``CPU`` ``Ascend``
|
|
@@ -3113,7 +3127,7 @@ class NormalizePad(ImageTensorOperation):
|
|
|
3113
3127
|
The standard deviation values must be in range (0.0, 255.0].
|
|
3114
3128
|
dtype (str, optional): Set the output data type of normalized image. Default: ``"float32"``.
|
|
3115
3129
|
is_hwc (bool, optional): Specify the format of input image.
|
|
3116
|
-
``True`` -
|
|
3130
|
+
``True`` - HWC format, ``False`` - CHW format. Default: ``True``.
|
|
3117
3131
|
|
|
3118
3132
|
Raises:
|
|
3119
3133
|
TypeError: If `mean` is not of type sequence.
|
|
@@ -3175,14 +3189,20 @@ class Pad(ImageTensorOperation, PyTensorOperation):
|
|
|
3175
3189
|
Args:
|
|
3176
3190
|
padding (Union[int, Sequence[int, int], Sequence[int, int, int, int]]): The number of pixels
|
|
3177
3191
|
to pad each border of the image.
|
|
3178
|
-
|
|
3179
|
-
If a
|
|
3180
|
-
|
|
3181
|
-
|
|
3192
|
+
|
|
3193
|
+
- If a single number is provided, it pads all borders with this value.
|
|
3194
|
+
- If a tuple or lists of 2 values are provided, it pads the (left and right)
|
|
3195
|
+
with the first value and (top and bottom) with the second value.
|
|
3196
|
+
- If 4 values are provided as a list or tuple, it pads the left, top, right and bottom respectively.
|
|
3197
|
+
|
|
3182
3198
|
The pad values must be non-negative.
|
|
3199
|
+
|
|
3183
3200
|
fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
|
|
3184
|
-
`padding_mode` ``Border.CONSTANT``.
|
|
3185
|
-
|
|
3201
|
+
`padding_mode` ``Border.CONSTANT``.
|
|
3202
|
+
|
|
3203
|
+
- If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
3204
|
+
- If it is an integer, it is used for all RGB channels.
|
|
3205
|
+
|
|
3186
3206
|
The fill_value values must be in range [0, 255]. Default: ``0``.
|
|
3187
3207
|
padding_mode (Border, optional): The method of padding. Default: ``Border.CONSTANT``. Can be
|
|
3188
3208
|
``Border.CONSTANT``, ``Border.EDGE``, ``Border.REFLECT``, ``Border.SYMMETRIC``.
|
|
@@ -3250,15 +3270,15 @@ class Pad(ImageTensorOperation, PyTensorOperation):
|
|
|
3250
3270
|
"""
|
|
3251
3271
|
Set the device for the current operator execution.
|
|
3252
3272
|
|
|
3253
|
-
|
|
3273
|
+
When the device is Ascend, input/output shape should be limited from [4, 6] to [32768, 32768].
|
|
3254
3274
|
|
|
3255
3275
|
Args:
|
|
3256
3276
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
3257
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
3277
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
3258
3278
|
|
|
3259
3279
|
Raises:
|
|
3260
3280
|
TypeError: If `device_target` is not of type str.
|
|
3261
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
3281
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
3262
3282
|
|
|
3263
3283
|
Supported Platforms:
|
|
3264
3284
|
``CPU`` ``Ascend``
|
|
@@ -3403,6 +3423,9 @@ class Perspective(ImageTensorOperation, PyTensorOperation):
|
|
|
3403
3423
|
interpolation (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
3404
3424
|
Default: ``Inter.BILINEAR``.
|
|
3405
3425
|
|
|
3426
|
+
- Ascend Mode: Only ``Inter.LINEAR`` and ``Inter.NEAREST`` interpolation methods are supported
|
|
3427
|
+
when the device is set to Ascend by `.device("Ascend")` .
|
|
3428
|
+
|
|
3406
3429
|
Raises:
|
|
3407
3430
|
TypeError: If `start_points` is not of type Sequence[Sequence[int, int]].
|
|
3408
3431
|
TypeError: If `end_points` is not of type Sequence[Sequence[int, int]].
|
|
@@ -3461,17 +3484,17 @@ class Perspective(ImageTensorOperation, PyTensorOperation):
|
|
|
3461
3484
|
"""
|
|
3462
3485
|
Set the device for the current operator execution.
|
|
3463
3486
|
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3487
|
+
When the device is Ascend, input type supports `uint8` and `float32`,
|
|
3488
|
+
input channel supports 1 and 3. The input data has a height limit of [6, 8192]
|
|
3489
|
+
and a width limit of [10, 4096].
|
|
3467
3490
|
|
|
3468
3491
|
Args:
|
|
3469
3492
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
3470
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
3493
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
3471
3494
|
|
|
3472
3495
|
Raises:
|
|
3473
3496
|
TypeError: If `device_target` is not of type str.
|
|
3474
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
3497
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
3475
3498
|
|
|
3476
3499
|
Supported Platforms:
|
|
3477
3500
|
``CPU`` ``Ascend``
|
|
@@ -3585,16 +3608,16 @@ class Posterize(ImageTensorOperation):
|
|
|
3585
3608
|
"""
|
|
3586
3609
|
Set the device for the current operator execution.
|
|
3587
3610
|
|
|
3588
|
-
|
|
3589
|
-
|
|
3611
|
+
When the device is Ascend, input type supports `uint8`/`float32`, input channel supports 1 and 3.
|
|
3612
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
3590
3613
|
|
|
3591
3614
|
Args:
|
|
3592
3615
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
3593
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
3616
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
3594
3617
|
|
|
3595
3618
|
Raises:
|
|
3596
3619
|
TypeError: If `device_target` is not of type str.
|
|
3597
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
3620
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
3598
3621
|
|
|
3599
3622
|
Supported Platforms:
|
|
3600
3623
|
``CPU`` ``Ascend``
|
|
@@ -3779,26 +3802,30 @@ class RandomAffine(ImageTensorOperation, PyTensorOperation):
|
|
|
3779
3802
|
If `degrees` is a number, the range will be (-degrees, degrees).
|
|
3780
3803
|
If `degrees` is a sequence, it should be (min, max).
|
|
3781
3804
|
translate (sequence, optional): Sequence (tx_min, tx_max, ty_min, ty_max) of minimum/maximum translation in
|
|
3782
|
-
x(horizontal) and y(vertical) directions, range [-1.0, 1.0].
|
|
3805
|
+
x(horizontal) and y(vertical) directions, range [-1.0, 1.0].
|
|
3806
|
+
Default: ``None``, which means no translation is applied.
|
|
3783
3807
|
The horizontal and vertical shift is selected randomly from the range:
|
|
3784
3808
|
(tx_min*width, tx_max*width) and (ty_min*height, ty_max*height), respectively.
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3809
|
+
|
|
3810
|
+
- If a tuple or list of size 2, then a translate parallel to the X axis in the range of
|
|
3811
|
+
(translate[0], translate[1]) is applied.
|
|
3812
|
+
- If a tuple or list of size 4, then a translate parallel to the X axis in the range of
|
|
3813
|
+
(translate[0], translate[1]) and a translate parallel to the Y axis in the range of
|
|
3814
|
+
(translate[2], translate[3]) are applied.
|
|
3815
|
+
|
|
3791
3816
|
scale (sequence, optional): Scaling factor interval, which must be non negative.
|
|
3792
3817
|
Default: ``None``, original scale is used.
|
|
3793
3818
|
shear (Union[float, Sequence[float, float], Sequence[float, float, float, float]], optional):
|
|
3794
|
-
Range of shear factor to select from.
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3819
|
+
Range of shear factor to select from. Default: ``None``, means no shearing.
|
|
3820
|
+
|
|
3821
|
+
- If float is provided, a shearing parallel to X axis with a factor selected from
|
|
3822
|
+
( `-shear` , `shear` ) will be applied.
|
|
3823
|
+
- If Sequence[float, float] is provided, a shearing parallel to X axis with a factor selected
|
|
3824
|
+
from ( `shear` [0], `shear` [1]) will be applied.
|
|
3825
|
+
- If Sequence[float, float, float, float] is provided, a shearing parallel to X axis with a factor selected
|
|
3826
|
+
from ( `shear` [0], `shear` [1]) and a shearing parallel to Y axis with a factor selected from
|
|
3827
|
+
( `shear` [2], `shear` [3]) will be applied.
|
|
3828
|
+
|
|
3802
3829
|
resample (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
3803
3830
|
Default: ``Inter.NEAREST``.
|
|
3804
3831
|
fill_value (Union[int, tuple[int]], optional): Optional fill_value to fill the area outside the transform
|
|
@@ -4172,22 +4199,28 @@ class RandomCrop(ImageTensorOperation, PyTensorOperation):
|
|
|
4172
4199
|
|
|
4173
4200
|
Args:
|
|
4174
4201
|
size (Union[int, Sequence[int]]): The output size of the cropped image. The size value(s) must be positive.
|
|
4175
|
-
|
|
4176
|
-
If size is
|
|
4202
|
+
|
|
4203
|
+
- If size is an integer, a square crop of size (size, size) is returned.
|
|
4204
|
+
- If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
4205
|
+
|
|
4177
4206
|
padding (Union[int, Sequence[int]], optional): The number of pixels to pad each border of the image.
|
|
4178
4207
|
The padding value(s) must be non-negative. Default: ``None``.
|
|
4179
|
-
|
|
4180
|
-
If
|
|
4181
|
-
If a
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4208
|
+
|
|
4209
|
+
- If `padding` is not ``None``, pad image first with padding values.
|
|
4210
|
+
- If a single number is provided, pad all borders with this value.
|
|
4211
|
+
- If a tuple or lists of 2 values are provided, pad the (left and right)
|
|
4212
|
+
with the first value and (top and bottom) with the second value.
|
|
4213
|
+
- If 4 values are provided as a list or tuple,
|
|
4214
|
+
pad the left, top, right and bottom respectively.
|
|
4215
|
+
|
|
4185
4216
|
pad_if_needed (bool, optional): Pad the image if either side is smaller than
|
|
4186
4217
|
the given output size. Default: ``False``.
|
|
4187
4218
|
fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
|
|
4188
|
-
padding_mode Border.CONSTANT.
|
|
4189
|
-
|
|
4190
|
-
|
|
4219
|
+
padding_mode Border.CONSTANT. The fill_value values must be in range [0, 255]. Default: ``0``.
|
|
4220
|
+
|
|
4221
|
+
- If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
4222
|
+
- If it is an integer, it is used for all RGB channels.
|
|
4223
|
+
|
|
4191
4224
|
padding_mode (Border, optional): The method of padding. Default: ``Border.CONSTANT``. It can be any of
|
|
4192
4225
|
``Border.CONSTANT``, ``Border.EDGE``, ``Border.REFLECT``, ``Border.SYMMETRIC``.
|
|
4193
4226
|
|
|
@@ -5352,7 +5385,7 @@ class RandomResizedCropWithBBox(ImageTensorOperation):
|
|
|
5352
5385
|
|
|
5353
5386
|
class RandomResize(ImageTensorOperation):
|
|
5354
5387
|
"""
|
|
5355
|
-
Resize the input image using :class
|
|
5388
|
+
Resize the input image using a randomly selected :class:`mindspore.dataset.vision.Inter` interpolation method.
|
|
5356
5389
|
|
|
5357
5390
|
Args:
|
|
5358
5391
|
size (Union[int, Sequence[int]]): The output size of the resized image. The size value(s) must be positive.
|
|
@@ -5996,9 +6029,18 @@ class Resize(ImageTensorOperation, PyTensorOperation):
|
|
|
5996
6029
|
If size is an integer, the smaller edge of the image will be resized to this value with
|
|
5997
6030
|
the same image aspect ratio.
|
|
5998
6031
|
If size is a sequence of length 2, it should be (height, width).
|
|
6032
|
+
|
|
6033
|
+
- CPU mode: If the execution device is CPU by ``.device("CPU")`` , the range of size is [1, 16777216].
|
|
6034
|
+
|
|
6035
|
+
- Ascend mode: set the executing device to Ascend by ``.device("Ascend")`` , the value of size will be in
|
|
6036
|
+
the range of [6, 32768].
|
|
6037
|
+
|
|
5999
6038
|
interpolation (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
6000
6039
|
Default: ``Inter.LINEAR``.
|
|
6001
6040
|
|
|
6041
|
+
- Ascend mode: ``Inter.ANTIALIAS`` , ``Inter.AREA`` , ``Inter.PILCUBIC`` interpolation methods are not
|
|
6042
|
+
supported when the execution device is set to Ascend by ``.device("Ascend")`` .
|
|
6043
|
+
|
|
6002
6044
|
Raises:
|
|
6003
6045
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
6004
6046
|
TypeError: If `interpolation` is not of type :class:`~.vision.Inter` .
|
|
@@ -6055,15 +6097,15 @@ class Resize(ImageTensorOperation, PyTensorOperation):
|
|
|
6055
6097
|
"""
|
|
6056
6098
|
Set the device for the current operator execution.
|
|
6057
6099
|
|
|
6058
|
-
|
|
6100
|
+
When the device is Ascend, input/output shape should be limited from [4, 6] to [32768, 32768].
|
|
6059
6101
|
|
|
6060
6102
|
Args:
|
|
6061
6103
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
6062
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
6104
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
6063
6105
|
|
|
6064
6106
|
Raises:
|
|
6065
6107
|
TypeError: If `device_target` is not of type str.
|
|
6066
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
6108
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
6067
6109
|
|
|
6068
6110
|
Supported Platforms:
|
|
6069
6111
|
``CPU`` ``Ascend``
|
|
@@ -6132,9 +6174,11 @@ class ResizedCrop(ImageTensorOperation):
|
|
|
6132
6174
|
height (int): Height of the crop region.
|
|
6133
6175
|
width (int): Width of the cropp region.
|
|
6134
6176
|
size (Union[int, Sequence[int, int]]): The size of the output image.
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6177
|
+
|
|
6178
|
+
- If int is provided, the smaller edge of the image will be resized to this value,
|
|
6179
|
+
keeping the image aspect ratio the same.
|
|
6180
|
+
- If Sequence[int, int] is provided, it should be (height, width).
|
|
6181
|
+
|
|
6138
6182
|
interpolation (Inter, optional): Image interpolation method defined by :class:`~.vision.Inter` .
|
|
6139
6183
|
Default: ``Inter.BILINEAR``.
|
|
6140
6184
|
|
|
@@ -6201,17 +6245,17 @@ class ResizedCrop(ImageTensorOperation):
|
|
|
6201
6245
|
"""
|
|
6202
6246
|
Set the device for the current operator execution.
|
|
6203
6247
|
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6248
|
+
When the device is Ascend, input type supports `uint8` and `float32`,
|
|
6249
|
+
input channel supports 1 and 3. The input data has a height limit of [4, 32768]
|
|
6250
|
+
and a width limit of [6, 32768].
|
|
6207
6251
|
|
|
6208
6252
|
Args:
|
|
6209
6253
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
6210
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
6254
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
6211
6255
|
|
|
6212
6256
|
Raises:
|
|
6213
6257
|
TypeError: If `device_target` is not of type str.
|
|
6214
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
6258
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
6215
6259
|
|
|
6216
6260
|
Supported Platforms:
|
|
6217
6261
|
``CPU`` ``Ascend``
|
|
@@ -6478,11 +6522,11 @@ class Rotate(ImageTensorOperation):
|
|
|
6478
6522
|
|
|
6479
6523
|
Args:
|
|
6480
6524
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
6481
|
-
``CPU`` and ``Ascend`` . Default: ``CPU`` .
|
|
6525
|
+
``"CPU"`` and ``"Ascend"`` . Default: ``"CPU"`` .
|
|
6482
6526
|
|
|
6483
6527
|
Raises:
|
|
6484
6528
|
TypeError: If `device_target` is not of type str.
|
|
6485
|
-
ValueError: If `device_target` is not within the valid set of [
|
|
6529
|
+
ValueError: If `device_target` is not within the valid set of ["CPU", "Ascend"].
|
|
6486
6530
|
|
|
6487
6531
|
Supported Platforms:
|
|
6488
6532
|
``CPU`` ``Ascend``
|
|
@@ -6660,8 +6704,8 @@ class Solarize(ImageTensorOperation):
|
|
|
6660
6704
|
"""
|
|
6661
6705
|
Set the device for the current operator execution.
|
|
6662
6706
|
|
|
6663
|
-
|
|
6664
|
-
|
|
6707
|
+
When the device is Ascend, input type only supports `uint8` , input channel supports 1 and 3.
|
|
6708
|
+
The input data has a height limit of [4, 8192] and a width limit of [6, 4096].
|
|
6665
6709
|
|
|
6666
6710
|
Args:
|
|
6667
6711
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|
|
@@ -7238,9 +7282,9 @@ class VerticalFlip(ImageTensorOperation):
|
|
|
7238
7282
|
"""
|
|
7239
7283
|
Set the device for the current operator execution.
|
|
7240
7284
|
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7285
|
+
When the device is Ascend, input type supports `uint8` and `float32`,
|
|
7286
|
+
input channel supports 1 and 3. The input data has a height limit of [4, 8192]
|
|
7287
|
+
and a width limit of [6, 4096].
|
|
7244
7288
|
|
|
7245
7289
|
Args:
|
|
7246
7290
|
device_target (str, optional): The operator will be executed on this device. Currently supports
|