mindspore 1.10.0__cp38-cp38-win_amd64.whl → 2.0.0rc1__cp38-cp38-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/ConcurrencyCheck.dll +0 -0
- mindspore/CppBuildInsights.dll +0 -0
- mindspore/CppCoreCheck.dll +0 -0
- mindspore/EnumIndex.dll +0 -0
- mindspore/EspXEngine.dll +0 -0
- mindspore/HResultCheck.dll +0 -0
- mindspore/KernelTraceControl.dll +0 -0
- mindspore/LocalESPC.dll +0 -0
- mindspore/Microsoft.Diagnostics.Tracing.EventSource.dll +0 -0
- mindspore/Microsoft.VisualStudio.RemoteControl.dll +0 -0
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Microsoft.VisualStudio.Utilities.Internal.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- mindspore/VariantClear.dll +0 -0
- mindspore/__init__.py +9 -4
- mindspore/_c_dataengine.cp38-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp38-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp38-win_amd64.pyd +0 -0
- mindspore/_check_jit_forbidden_api.py +102 -0
- mindspore/_checkparam.py +1066 -1001
- mindspore/_extends/builtin_operations.py +32 -4
- mindspore/_extends/graph_kernel/model/graph_split.py +66 -222
- mindspore/_extends/parallel_compile/akg_compiler/akg_process.py +12 -9
- mindspore/_extends/parallel_compile/akg_compiler/build_tbe_kernel.py +119 -26
- mindspore/_extends/parallel_compile/akg_compiler/tbe_topi.py +50 -50
- mindspore/_extends/parallel_compile/akg_compiler/util.py +9 -6
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py +4 -25
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +9 -4
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job_manager.py +1 -27
- mindspore/_extends/parse/__init__.py +5 -3
- mindspore/_extends/parse/namespace.py +17 -2
- mindspore/_extends/parse/parser.py +193 -34
- mindspore/_extends/parse/resources.py +7 -8
- mindspore/_extends/parse/standard_method.py +1780 -435
- mindspore/_extends/parse/trope.py +3 -1
- mindspore/amp.py +53 -58
- mindspore/atlprov.dll +0 -0
- mindspore/boost/adasum.py +3 -2
- mindspore/boost/boost.py +2 -2
- mindspore/boost/boost_cell_wrapper.py +46 -26
- mindspore/boost/dim_reduce.py +6 -5
- mindspore/boost/grad_accumulation.py +2 -1
- mindspore/boost/group_loss_scale_manager.py +1 -1
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/cfgpersist.dll +0 -0
- mindspore/clang_rt.asan_dbg_dynamic-x86_64.dll +0 -0
- mindspore/clang_rt.asan_dynamic-x86_64.dll +0 -0
- mindspore/common/__init__.py +11 -10
- mindspore/common/_decorator.py +2 -0
- mindspore/common/_register_for_adapter.py +55 -0
- mindspore/common/_stub_tensor.py +201 -0
- mindspore/common/_utils.py +57 -0
- mindspore/common/api.py +582 -297
- mindspore/common/dtype.py +66 -18
- mindspore/common/dump.py +2 -2
- mindspore/common/initializer.py +38 -1
- mindspore/common/jit_config.py +25 -13
- mindspore/common/mutable.py +53 -24
- mindspore/common/parameter.py +60 -37
- mindspore/common/seed.py +8 -24
- mindspore/common/sparse_tensor.py +927 -0
- mindspore/common/tensor.py +1627 -3900
- mindspore/communication/__init__.py +10 -5
- mindspore/communication/_comm_helper.py +78 -214
- mindspore/communication/_hccl_management.py +2 -1
- mindspore/communication/management.py +136 -47
- mindspore/config/op_info.config +501 -1008
- mindspore/context.py +291 -56
- mindspore/d3dcompiler_47.dll +0 -0
- mindspore/dataset/__init__.py +12 -8
- mindspore/dataset/audio/__init__.py +9 -9
- mindspore/dataset/audio/transforms.py +1090 -228
- mindspore/dataset/audio/utils.py +87 -39
- mindspore/dataset/audio/validators.py +223 -1
- mindspore/dataset/callback/ds_callback.py +17 -15
- mindspore/dataset/core/config.py +246 -17
- mindspore/dataset/core/py_util_helpers.py +4 -3
- mindspore/dataset/core/validator_helpers.py +10 -10
- mindspore/{parallel/nn/layers.py → dataset/debug/__init__.py} +7 -8
- mindspore/dataset/debug/debug_hook.py +65 -0
- mindspore/dataset/debug/pre_defined_hook.py +67 -0
- mindspore/dataset/engine/__init__.py +7 -3
- mindspore/dataset/engine/cache_client.py +9 -9
- mindspore/dataset/engine/datasets.py +648 -477
- mindspore/dataset/engine/datasets_audio.py +165 -167
- mindspore/dataset/engine/datasets_standard_format.py +93 -67
- mindspore/dataset/engine/datasets_text.py +492 -342
- mindspore/dataset/engine/datasets_user_defined.py +85 -50
- mindspore/dataset/engine/datasets_vision.py +1224 -699
- mindspore/dataset/engine/graphdata.py +134 -69
- mindspore/dataset/engine/iterators.py +50 -9
- mindspore/dataset/engine/offload.py +52 -31
- mindspore/dataset/engine/samplers.py +27 -24
- mindspore/dataset/engine/serializer_deserializer.py +14 -15
- mindspore/dataset/engine/validators.py +213 -52
- mindspore/dataset/text/__init__.py +10 -8
- mindspore/dataset/text/transforms.py +152 -57
- mindspore/dataset/text/utils.py +98 -49
- mindspore/dataset/text/validators.py +25 -0
- mindspore/dataset/transforms/__init__.py +4 -2
- mindspore/dataset/transforms/c_transforms.py +11 -13
- mindspore/dataset/transforms/py_transforms.py +2 -2
- mindspore/dataset/transforms/py_transforms_util.py +10 -0
- mindspore/dataset/transforms/transforms.py +13 -15
- mindspore/dataset/transforms/validators.py +7 -7
- mindspore/dataset/utils/__init__.py +2 -1
- mindspore/dataset/utils/browse_dataset.py +13 -13
- mindspore/dataset/utils/line_reader.py +121 -0
- mindspore/dataset/vision/__init__.py +8 -7
- mindspore/dataset/vision/c_transforms.py +125 -126
- mindspore/dataset/vision/py_transforms.py +37 -37
- mindspore/dataset/vision/py_transforms_util.py +23 -20
- mindspore/dataset/vision/transforms.py +316 -315
- mindspore/dataset/vision/utils.py +313 -17
- mindspore/dataset/vision/validators.py +6 -6
- mindspore/default_config.py +0 -1
- mindspore/dpcmi.dll +0 -0
- mindspore/{compression → experimental}/__init__.py +6 -5
- mindspore/experimental/map_parameter.py +275 -0
- mindspore/include/OWNERS +0 -1
- mindspore/include/api/callback/callback.h +9 -13
- mindspore/include/api/callback/ckpt_saver.h +2 -2
- mindspore/include/api/callback/loss_monitor.h +2 -2
- mindspore/include/api/callback/lr_scheduler.h +5 -5
- mindspore/include/api/callback/time_monitor.h +2 -2
- mindspore/include/api/callback/train_accuracy.h +4 -6
- mindspore/include/api/cfg.h +19 -6
- mindspore/include/api/context.h +70 -9
- mindspore/include/api/delegate.h +8 -1
- mindspore/include/api/dual_abi_helper.h +8 -24
- mindspore/include/api/metrics/accuracy.h +2 -2
- mindspore/include/api/metrics/metrics.h +4 -3
- mindspore/include/api/model.h +9 -4
- mindspore/include/api/model_group.h +68 -0
- mindspore/include/api/model_parallel_runner.h +17 -17
- mindspore/include/api/net.h +12 -11
- mindspore/include/api/serialization.h +20 -4
- mindspore/include/api/status.h +7 -1
- mindspore/include/api/types.h +25 -21
- mindspore/include/api/visible.h +4 -0
- mindspore/include/c_api/model_c.h +5 -0
- mindspore/include/c_api/status_c.h +1 -1
- mindspore/include/dataset/config.h +1 -1
- mindspore/include/dataset/constants.h +14 -0
- mindspore/include/dataset/text.h +59 -0
- mindspore/include/dataset/vision.h +56 -117
- mindspore/include/dataset/vision_lite.h +102 -0
- mindspore/jpeg62.dll +0 -0
- mindspore/log.py +28 -28
- mindspore/mindrecord/common/exceptions.py +2 -4
- mindspore/mindrecord/filereader.py +19 -1
- mindspore/mindrecord/filewriter.py +250 -88
- mindspore/mindrecord/mindpage.py +13 -13
- mindspore/mindrecord/shardheader.py +15 -15
- mindspore/mindrecord/shardreader.py +9 -0
- mindspore/mindrecord/shardwriter.py +29 -29
- mindspore/mindrecord/tools/cifar100_to_mr.py +9 -9
- mindspore/mindrecord/tools/cifar10_to_mr.py +9 -9
- mindspore/mindrecord/tools/csv_to_mr.py +4 -4
- mindspore/mindrecord/tools/imagenet_to_mr.py +70 -65
- mindspore/mindrecord/tools/mnist_to_mr.py +41 -41
- mindspore/mindrecord/tools/tfrecord_to_mr.py +6 -6
- mindspore/{libmindspore_backend.dll → mindspore_backend.dll} +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_shared_lib.dll +0 -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 +1 -5
- mindspore/nn/cell.py +297 -234
- mindspore/nn/dynamic_lr.py +1 -1
- mindspore/nn/grad/cell_grad.py +17 -42
- mindspore/nn/layer/__init__.py +7 -4
- mindspore/nn/layer/activation.py +131 -88
- mindspore/nn/layer/basic.py +313 -613
- mindspore/nn/layer/channel_shuffle.py +103 -0
- mindspore/nn/layer/combined.py +1 -1
- mindspore/nn/layer/container.py +52 -6
- mindspore/nn/layer/conv.py +112 -43
- mindspore/nn/layer/dense.py +10 -9
- mindspore/nn/layer/embedding.py +36 -34
- mindspore/nn/layer/image.py +123 -27
- mindspore/nn/layer/math.py +108 -107
- mindspore/nn/layer/normalization.py +212 -366
- mindspore/nn/layer/padding.py +370 -42
- mindspore/nn/layer/pooling.py +1443 -219
- mindspore/nn/layer/rnn_cells.py +11 -16
- mindspore/nn/layer/rnns.py +38 -39
- mindspore/nn/layer/thor_layer.py +24 -25
- mindspore/nn/layer/timedistributed.py +5 -5
- mindspore/nn/layer/transformer.py +701 -0
- mindspore/nn/learning_rate_schedule.py +8 -8
- mindspore/nn/loss/__init__.py +9 -6
- mindspore/nn/loss/loss.py +678 -142
- mindspore/nn/metrics.py +53 -0
- mindspore/nn/optim/_dist_optimizer_registry.py +2 -2
- mindspore/nn/optim/ada_grad.py +8 -8
- mindspore/nn/optim/adadelta.py +2 -3
- mindspore/nn/optim/adafactor.py +18 -14
- mindspore/nn/optim/adam.py +429 -87
- mindspore/nn/optim/adamax.py +5 -6
- mindspore/nn/optim/adasum.py +10 -8
- mindspore/nn/optim/asgd.py +7 -7
- mindspore/nn/optim/ftrl.py +81 -11
- mindspore/nn/optim/lamb.py +7 -8
- mindspore/nn/optim/lars.py +4 -4
- mindspore/nn/optim/lazyadam.py +82 -7
- mindspore/nn/optim/momentum.py +8 -7
- mindspore/nn/optim/optimizer.py +19 -10
- mindspore/nn/optim/proximal_ada_grad.py +6 -5
- mindspore/nn/optim/rmsprop.py +3 -3
- mindspore/nn/optim/rprop.py +20 -16
- mindspore/nn/optim/sgd.py +21 -15
- mindspore/nn/optim/thor.py +23 -21
- mindspore/nn/probability/__init__.py +0 -2
- mindspore/nn/probability/bijector/bijector.py +7 -6
- mindspore/nn/probability/bijector/invert.py +4 -2
- mindspore/nn/probability/bijector/softplus.py +2 -2
- mindspore/nn/probability/bnn_layers/dense_variational.py +1 -1
- mindspore/nn/probability/bnn_layers/layer_distribution.py +2 -2
- mindspore/nn/probability/distribution/__init__.py +6 -0
- mindspore/nn/probability/distribution/_utils/custom_ops.py +3 -2
- mindspore/nn/probability/distribution/_utils/utils.py +11 -17
- mindspore/nn/probability/distribution/bernoulli.py +6 -6
- mindspore/nn/probability/distribution/beta.py +1 -1
- mindspore/nn/probability/distribution/categorical.py +9 -9
- mindspore/nn/probability/distribution/cauchy.py +8 -8
- mindspore/nn/probability/distribution/distribution.py +12 -6
- mindspore/nn/probability/distribution/exponential.py +5 -5
- mindspore/nn/probability/distribution/gamma.py +3 -3
- mindspore/nn/probability/distribution/geometric.py +6 -5
- mindspore/nn/probability/distribution/gumbel.py +5 -5
- mindspore/nn/probability/distribution/half_normal.py +133 -0
- mindspore/nn/probability/distribution/laplace.py +128 -0
- mindspore/nn/probability/distribution/log_normal.py +0 -1
- mindspore/nn/probability/distribution/logistic.py +4 -5
- mindspore/nn/probability/distribution/normal.py +11 -15
- mindspore/nn/probability/distribution/poisson.py +6 -2
- mindspore/nn/probability/distribution/student_t.py +150 -0
- mindspore/nn/probability/distribution/transformed_distribution.py +4 -4
- mindspore/nn/probability/distribution/uniform.py +5 -5
- mindspore/nn/reinforcement/_tensors_queue.py +3 -3
- mindspore/nn/reinforcement/tensor_array.py +2 -2
- mindspore/nn/sparse/sparse.py +8 -1
- mindspore/nn/wrap/cell_wrapper.py +55 -27
- mindspore/nn/wrap/grad_reducer.py +20 -11
- mindspore/nn/wrap/loss_scale.py +47 -30
- mindspore/numpy/array_creations.py +33 -22
- mindspore/numpy/array_ops.py +46 -42
- mindspore/numpy/logic_ops.py +6 -27
- mindspore/numpy/math_ops.py +26 -19
- mindspore/numpy/utils.py +1 -8
- mindspore/numpy/utils_const.py +112 -62
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/__init__.py +6 -3
- mindspore/ops/_constants.py +0 -6
- mindspore/ops/_grad/__init__.py +2 -1
- mindspore/ops/_grad/grad_array_ops.py +209 -152
- mindspore/ops/_grad/grad_base.py +55 -17
- mindspore/ops/_grad/grad_clip_ops.py +11 -3
- mindspore/ops/_grad/grad_comm_ops.py +58 -47
- mindspore/ops/_grad/grad_implementations.py +21 -61
- mindspore/ops/_grad/grad_inner_ops.py +48 -6
- mindspore/ops/_grad/grad_math_ops.py +306 -161
- mindspore/ops/_grad/grad_nn_ops.py +192 -181
- mindspore/ops/_grad/grad_other_ops.py +1 -1
- mindspore/ops/_grad/grad_quant_ops.py +5 -5
- mindspore/ops/_grad/grad_sequence_ops.py +296 -0
- mindspore/ops/_grad/grad_sparse.py +15 -9
- mindspore/ops/_grad_experimental/__init__.py +1 -0
- mindspore/ops/_grad_experimental/grad_array_ops.py +441 -55
- mindspore/ops/_grad_experimental/grad_image_ops.py +25 -7
- mindspore/ops/_grad_experimental/grad_inner_ops.py +3 -44
- mindspore/ops/_grad_experimental/grad_linalg_ops.py +16 -21
- mindspore/ops/_grad_experimental/grad_math_ops.py +979 -49
- mindspore/ops/_grad_experimental/grad_nn_ops.py +78 -8
- mindspore/ops/_grad_experimental/grad_scalar_ops.py +112 -0
- mindspore/ops/_grad_experimental/grad_sparse_ops.py +197 -13
- mindspore/ops/_op_impl/__init__.py +3 -3
- mindspore/ops/_op_impl/_custom_op/__init__.py +0 -1
- mindspore/ops/_op_impl/_custom_op/_basic.py +0 -1
- mindspore/ops/_op_impl/_custom_op/batch_matmul_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/batchnorm_fold.py +4 -2
- mindspore/ops/_op_impl/_custom_op/batchnorm_fold2.py +2 -2
- mindspore/ops/_op_impl/_custom_op/batchnorm_fold2_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/batchnorm_fold2_grad_reduce.py +5 -5
- mindspore/ops/_op_impl/_custom_op/batchnorm_fold_grad.py +3 -3
- mindspore/ops/_op_impl/_custom_op/cholesky_trsm_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/correction_mul.py +3 -3
- mindspore/ops/_op_impl/_custom_op/correction_mul_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/dsd_back_impl.py +4 -8
- mindspore/ops/_op_impl/_custom_op/dsd_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perchannel.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perchannel_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perchannel_grad_reduce.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perlayer.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perlayer_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perlayer_grad_reduce.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_quant_perchannel.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_quant_perchannel_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_quant_perlayer.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fake_quant_perlayer_grad.py +2 -2
- mindspore/ops/_op_impl/_custom_op/fused_abs_max1_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/img2col_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/matmul_cube_dense_left_impl.py +2 -2
- mindspore/ops/_op_impl/_custom_op/matmul_cube_dense_right_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_left_cast_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_right_mul_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/matmul_cube_impl.py +2 -2
- mindspore/ops/_op_impl/_custom_op/matmul_dds_grad_impl.py +0 -1
- mindspore/ops/_op_impl/_custom_op/matmul_dds_impl.py +0 -1
- mindspore/ops/_op_impl/_custom_op/matrix_combine_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/minmax_update_perchannel.py +2 -2
- mindspore/ops/_op_impl/_custom_op/minmax_update_perlayer.py +2 -2
- mindspore/ops/_op_impl/_custom_op/transpose02314_impl.py +1 -1
- mindspore/ops/_op_impl/aicpu/__init__.py +238 -3
- mindspore/ops/_op_impl/aicpu/abs.py +36 -0
- mindspore/ops/_op_impl/aicpu/adaptive_avg_pool_2d.py +34 -0
- mindspore/ops/_op_impl/aicpu/adaptive_avg_pool_2d_grad.py +34 -0
- mindspore/ops/_op_impl/aicpu/adaptive_avg_pool_3d.py +39 -0
- mindspore/ops/_op_impl/aicpu/adaptive_avg_pool_3d_grad.py +39 -0
- mindspore/ops/_op_impl/aicpu/adaptive_max_pool_2d_grad.py +37 -0
- mindspore/ops/_op_impl/aicpu/adaptive_max_pool_3d.py +42 -0
- mindspore/ops/_op_impl/aicpu/adaptive_max_pool_3d_grad.py +152 -0
- mindspore/ops/_op_impl/aicpu/add.py +43 -0
- mindspore/ops/_op_impl/aicpu/addcdiv.py +0 -32
- mindspore/ops/_op_impl/aicpu/addcmul.py +0 -84
- mindspore/ops/_op_impl/aicpu/affine_grid_grad.py +35 -0
- mindspore/ops/_op_impl/aicpu/arg_max.py +75 -0
- mindspore/ops/_op_impl/aicpu/arg_min.py +75 -0
- mindspore/ops/_op_impl/aicpu/argmin_with_value.py +43 -0
- mindspore/ops/_op_impl/aicpu/batch_matmul.py +43 -0
- mindspore/ops/_op_impl/aicpu/batch_norm_grad_grad.py +49 -0
- mindspore/ops/_op_impl/aicpu/bernoulli.py +48 -0
- mindspore/ops/_op_impl/aicpu/bessel_i0.py +31 -0
- mindspore/ops/_op_impl/aicpu/bias_add.py +44 -0
- mindspore/ops/_op_impl/aicpu/bias_add_grad.py +43 -0
- mindspore/ops/_op_impl/aicpu/bincount.py +33 -0
- mindspore/{nn/probability/infer/variational/__init__.py → ops/_op_impl/aicpu/cauchy.py} +17 -10
- mindspore/ops/_op_impl/aicpu/channel_shuffle.py +40 -0
- mindspore/ops/_op_impl/aicpu/cholesky.py +1 -1
- mindspore/ops/_op_impl/{cpu/bias_add.py → aicpu/choleskygrad.py} +9 -7
- mindspore/ops/_op_impl/aicpu/combined_non_max_suppression.py +42 -0
- mindspore/ops/_op_impl/aicpu/concat_offset.py +42 -0
- mindspore/ops/_op_impl/aicpu/concat_offset_v1.py +31 -0
- mindspore/ops/_op_impl/aicpu/conj.py +11 -0
- mindspore/ops/_op_impl/aicpu/crop_and_resize_grad_image.py +38 -0
- mindspore/ops/_op_impl/aicpu/cumulative_logsumexp.py +36 -0
- mindspore/ops/_op_impl/aicpu/deformable_offsets.py +38 -0
- mindspore/ops/_op_impl/aicpu/deformable_offsets_grad.py +2 -2
- mindspore/ops/_op_impl/aicpu/dense_to_sparse_set_operation.py +48 -0
- mindspore/ops/_op_impl/aicpu/diag.py +36 -0
- mindspore/ops/_op_impl/aicpu/diag_part.py +36 -0
- mindspore/ops/_op_impl/aicpu/diagonal.py +35 -0
- mindspore/ops/_op_impl/{cpu/bias_add_grad.py → aicpu/digamma.py} +9 -7
- mindspore/ops/_op_impl/aicpu/eig.py +35 -0
- mindspore/ops/_op_impl/aicpu/fft_with_size.py +41 -0
- mindspore/ops/_op_impl/aicpu/flatten.py +1 -0
- mindspore/ops/_op_impl/aicpu/fmax.py +36 -0
- mindspore/ops/_op_impl/aicpu/fmin.py +37 -0
- mindspore/ops/_op_impl/aicpu/fractional_max_pool3d_with_fixed_ksize.py +1 -1
- mindspore/ops/_op_impl/aicpu/fse_decode.py +43 -0
- mindspore/ops/_op_impl/aicpu/glu.py +33 -0
- mindspore/ops/_op_impl/aicpu/glu_grad.py +34 -0
- mindspore/ops/_op_impl/aicpu/greater.py +41 -0
- mindspore/ops/_op_impl/aicpu/greater_equal.py +41 -0
- mindspore/ops/_op_impl/aicpu/index_put.py +50 -0
- mindspore/ops/_op_impl/{tbe/scatter_add_ds.py → aicpu/inplace_index_add.py} +17 -21
- mindspore/ops/_op_impl/aicpu/instance_norm_v2.py +41 -0
- mindspore/ops/_op_impl/aicpu/instance_norm_v2_grad.py +44 -0
- mindspore/ops/_op_impl/aicpu/layer_norm_grad_grad.py +47 -0
- mindspore/ops/_op_impl/aicpu/less.py +41 -0
- mindspore/ops/_op_impl/aicpu/less_equal.py +41 -0
- mindspore/ops/_op_impl/aicpu/lgamma.py +32 -0
- mindspore/ops/_op_impl/aicpu/log_normal_reverse.py +33 -0
- mindspore/ops/_op_impl/aicpu/logit.py +33 -0
- mindspore/ops/_op_impl/aicpu/logit_grad.py +34 -0
- mindspore/ops/_op_impl/aicpu/masked_fill.py +42 -0
- mindspore/ops/_op_impl/aicpu/masked_scatter.py +39 -0
- mindspore/ops/_op_impl/aicpu/matmul.py +39 -0
- mindspore/ops/_op_impl/aicpu/matrix_logarithm.py +31 -0
- mindspore/ops/_op_impl/aicpu/matrix_power.py +32 -0
- mindspore/ops/_op_impl/aicpu/matrix_solve_ls.py +36 -0
- mindspore/ops/_op_impl/aicpu/matrix_triangular_solve.py +36 -0
- mindspore/ops/_op_impl/aicpu/mirror_pad.py +2 -0
- mindspore/ops/_op_impl/aicpu/mirror_pad_grad.py +0 -4
- mindspore/ops/_op_impl/aicpu/mul.py +3 -1
- mindspore/ops/_op_impl/aicpu/multinomial.py +14 -6
- mindspore/ops/_op_impl/aicpu/multinomial_with_replacement.py +35 -0
- mindspore/ops/_op_impl/aicpu/nan_to_num.py +34 -0
- mindspore/ops/_op_impl/aicpu/nllloss.py +38 -0
- mindspore/ops/_op_impl/aicpu/nllloss_grad.py +39 -0
- mindspore/ops/_op_impl/aicpu/ones_like.py +0 -2
- mindspore/ops/_op_impl/aicpu/polar.py +32 -0
- mindspore/ops/_op_impl/aicpu/polygamma.py +34 -0
- mindspore/ops/_op_impl/aicpu/qr.py +36 -0
- mindspore/ops/_op_impl/aicpu/quant_dtype_cast.py +40 -0
- mindspore/ops/_op_impl/aicpu/quantile.py +35 -0
- mindspore/ops/_op_impl/aicpu/ragged_tensor_to_sparse.py +73 -0
- mindspore/ops/_op_impl/aicpu/ragged_tensor_to_tensor.py +74 -0
- mindspore/ops/_op_impl/aicpu/random_shuffle.py +3 -0
- mindspore/ops/_op_impl/aicpu/randperm_v2.py +41 -0
- mindspore/ops/_op_impl/aicpu/range.py +36 -0
- mindspore/ops/_op_impl/aicpu/reciprocal.py +34 -0
- mindspore/ops/_op_impl/aicpu/reciprocal_grad.py +35 -0
- mindspore/ops/_op_impl/aicpu/reduce_sum.py +57 -0
- mindspore/ops/_op_impl/aicpu/resize_bicubic.py +2 -8
- mindspore/ops/_op_impl/aicpu/resize_bicubic_grad.py +1 -1
- mindspore/ops/_op_impl/aicpu/resize_v2.py +68 -0
- mindspore/ops/_op_impl/aicpu/resize_v2_grad.py +68 -0
- mindspore/ops/_op_impl/aicpu/scatter_elements.py +4 -0
- mindspore/ops/_op_impl/aicpu/scatter_nd_update.py +2 -0
- mindspore/ops/_op_impl/aicpu/search_sorted.py +12 -6
- mindspore/ops/_op_impl/aicpu/self_adjoint_eig.py +34 -0
- mindspore/ops/_op_impl/aicpu/sequence_add.py +34 -0
- mindspore/ops/_op_impl/aicpu/sequence_add_offset.py +34 -0
- mindspore/ops/_op_impl/aicpu/sequence_addn.py +38 -0
- mindspore/ops/_op_impl/aicpu/slice_grad.py +76 -0
- mindspore/ops/_op_impl/aicpu/smooth_l1_loss.py +35 -0
- mindspore/ops/_op_impl/aicpu/smooth_l1_loss_grad.py +37 -0
- mindspore/ops/_op_impl/aicpu/sort.py +39 -0
- mindspore/ops/_op_impl/aicpu/sparse_apply_adagrad_da.py +0 -24
- mindspore/ops/_op_impl/aicpu/sparse_cross.py +42 -0
- mindspore/ops/_op_impl/aicpu/sparse_fill_empty_rows.py +63 -0
- mindspore/ops/_op_impl/aicpu/sparse_fill_empty_rows_grad.py +45 -0
- mindspore/ops/_op_impl/aicpu/sparse_matrix_mat_mul.py +56 -0
- mindspore/ops/_op_impl/{tbe/slice_ds.py → aicpu/sparse_segment_sum.py} +16 -24
- mindspore/ops/_op_impl/aicpu/sparse_segment_sum_with_num_segments.py +68 -0
- mindspore/ops/_op_impl/aicpu/sparse_slice.py +63 -0
- mindspore/ops/_op_impl/aicpu/sparse_slice_grad.py +61 -0
- mindspore/ops/_op_impl/aicpu/squared_difference.py +2 -0
- mindspore/ops/_op_impl/aicpu/strided_slice_v2.py +93 -0
- mindspore/ops/_op_impl/aicpu/strided_slice_v2_grad.py +66 -0
- mindspore/ops/_op_impl/aicpu/tensor_scatter_update.py +59 -0
- mindspore/ops/_op_impl/{tbe/gather_v2.py → aicpu/tile.py} +24 -24
- mindspore/ops/_op_impl/aicpu/tridiagonal_solve.py +35 -0
- mindspore/ops/_op_impl/aicpu/tril_indices.py +34 -0
- mindspore/ops/_op_impl/aicpu/triu_indices.py +34 -0
- mindspore/ops/_op_impl/aicpu/uniform.py +34 -0
- mindspore/ops/_op_impl/aicpu/uniform_candidate_sampler.py +1 -0
- mindspore/ops/_op_impl/aicpu/unique_consecutive.py +10 -2
- mindspore/ops/_op_impl/cpu/__init__.py +1 -2
- mindspore/ops/_op_impl/cpu/dynamic_shape.py +5 -1
- mindspore/ops/_op_impl/cpu/maximum_grad.py +2 -0
- mindspore/{compression/common/__init__.py → ops/_op_impl/cpu/pyexecute.py} +13 -8
- mindspore/ops/_op_impl/cpu/reduce_sum.py +8 -0
- mindspore/ops/_op_impl/cpu/sparse_slice.py +62 -0
- mindspore/ops/_op_impl/cpu/sparse_slice_grad.py +60 -0
- mindspore/ops/_op_impl/cpu/tensor_shape.py +5 -1
- mindspore/ops/_op_impl/tbe/__init__.py +27 -608
- mindspore/ops/_op_impl/tbe/addcdiv_ds.py +42 -0
- mindspore/ops/_op_impl/tbe/addcmul_ds.py +44 -0
- mindspore/ops/_op_impl/tbe/assign_add_ds.py +1 -0
- mindspore/ops/_op_impl/tbe/atomic_addr_clean.py +1 -1
- mindspore/ops/_op_impl/tbe/avg_pool_3d_grad.py +1 -1
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_c_state_grad_v2.py +0 -1
- mindspore/ops/_op_impl/tbe/batch_to_space.py +1 -1
- mindspore/ops/_op_impl/tbe/batch_to_space_nd.py +1 -1
- mindspore/ops/_op_impl/tbe/batch_to_space_nd_v2.py +41 -0
- mindspore/ops/_op_impl/tbe/bce_with_logits_loss.py +1 -0
- mindspore/ops/_op_impl/tbe/bias_add_grad.py +2 -0
- mindspore/ops/_op_impl/tbe/bn_infer_grad.py +4 -2
- mindspore/ops/_op_impl/tbe/bn_infer_grad_ds.py +40 -0
- mindspore/ops/_op_impl/tbe/bn_training_update.py +0 -1
- mindspore/ops/_op_impl/tbe/bn_training_update_ds.py +0 -1
- mindspore/ops/_op_impl/tbe/broadcast_to_ds.py +6 -4
- mindspore/ops/_op_impl/tbe/cast.py +0 -2
- mindspore/ops/_op_impl/tbe/cast_ds.py +3 -3
- mindspore/ops/_op_impl/tbe/ctc_loss_v2.py +0 -2
- mindspore/ops/_op_impl/tbe/ctc_loss_v2_grad.py +0 -2
- mindspore/ops/_op_impl/tbe/data_format_dim_map_ds.py +1 -0
- mindspore/ops/_op_impl/tbe/deformable_offsets.py +1 -0
- mindspore/ops/_op_impl/tbe/depthwise_conv2d.py +1 -1
- mindspore/ops/_op_impl/tbe/dynamic_atomic_addr_clean.py +1 -1
- mindspore/ops/_op_impl/tbe/gather_nd.py +1 -0
- mindspore/ops/_op_impl/tbe/greater.py +2 -0
- mindspore/ops/_op_impl/tbe/{index_add.py → inplace_index_add.py} +3 -6
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_v2.py +0 -1
- mindspore/ops/_op_impl/tbe/npu_clear_float_status_v2.py +35 -0
- mindspore/ops/_op_impl/tbe/npu_get_float_status_v2.py +35 -0
- mindspore/ops/_op_impl/tbe/one_hot_ds.py +0 -6
- mindspore/ops/_op_impl/tbe/{greater_ds.py → reduce_all_ds.py} +13 -16
- mindspore/ops/_op_impl/tbe/reduce_any_ds.py +39 -0
- mindspore/ops/_op_impl/tbe/roi_align_ds.py +44 -0
- mindspore/ops/_op_impl/tbe/roi_align_grad_ds.py +44 -0
- mindspore/ops/_op_impl/tbe/scatter_add.py +2 -0
- mindspore/ops/_op_impl/tbe/scatter_nd_add.py +2 -2
- mindspore/ops/_op_impl/tbe/slice.py +26 -15
- mindspore/ops/_op_impl/tbe/space_to_batch.py +1 -1
- mindspore/ops/_op_impl/tbe/space_to_batch_nd.py +1 -1
- mindspore/ops/_op_impl/tbe/strided_slice_grad_d.py +1 -0
- mindspore/ops/_op_impl/tbe/trans_data_ds.py +15 -5
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum.py +1 -1
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum_ds.py +2 -0
- mindspore/ops/_primitive_cache.py +3 -2
- mindspore/ops/_register_for_op.py +11 -0
- mindspore/ops/_utils/__init__.py +1 -1
- mindspore/ops/_utils/utils.py +20 -41
- mindspore/ops/_vmap/__init__.py +2 -2
- mindspore/ops/_vmap/vmap_array_ops.py +170 -78
- mindspore/ops/_vmap/vmap_base.py +24 -10
- mindspore/ops/_vmap/vmap_convolution_ops.py +7 -10
- mindspore/ops/_vmap/vmap_grad_math_ops.py +4 -4
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +41 -9
- mindspore/ops/_vmap/vmap_image_ops.py +52 -0
- mindspore/ops/_vmap/vmap_math_ops.py +77 -6
- mindspore/ops/_vmap/vmap_nn_ops.py +78 -29
- mindspore/ops/_vmap/vmap_other_ops.py +3 -1
- mindspore/ops/_vmap/vmap_random_ops.py +55 -3
- mindspore/ops/_vmap/vmap_sparse_ops.py +1 -0
- mindspore/ops/bprop_mindir/AdaptiveAvgPool2D_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/AdaptiveMaxPool2D_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/ApproximateEqual_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/Argmax_bprop.mindir +13 -12
- mindspore/ops/bprop_mindir/Argmin_bprop.mindir +14 -13
- mindspore/ops/bprop_mindir/AssignSub_bprop.mindir +17 -18
- mindspore/ops/bprop_mindir/Assign_bprop.mindir +16 -16
- mindspore/ops/bprop_mindir/AvgPool3D_bprop.mindir +150 -0
- mindspore/ops/bprop_mindir/AvgPool_bprop.mindir +66 -0
- mindspore/ops/bprop_mindir/BCEWithLogitsLoss_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/BNTrainingReduce_bprop.mindir +13 -12
- mindspore/ops/bprop_mindir/BatchNormGrad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/BatchToSpaceND_bprop.mindir +28 -0
- mindspore/ops/bprop_mindir/BiasAddGrad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/BinaryCrossEntropy_bprop.mindir +33 -0
- mindspore/ops/bprop_mindir/BroadcastTo_bprop.mindir +306 -0
- mindspore/ops/bprop_mindir/Broadcast_bprop.mindir +12 -8
- mindspore/ops/bprop_mindir/CTCLoss_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Concat_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Conv2DBackpropFilter_bprop.mindir +240 -0
- mindspore/ops/bprop_mindir/Conv2DBackpropInput_bprop.mindir +247 -0
- mindspore/ops/bprop_mindir/Conv2DTranspose_bprop.mindir +247 -0
- mindspore/ops/bprop_mindir/Conv3DTranspose_bprop.mindir +315 -0
- mindspore/ops/bprop_mindir/Conv3D_bprop.mindir +278 -0
- mindspore/ops/bprop_mindir/DType_bprop.mindir +12 -12
- mindspore/ops/bprop_mindir/DeformableOffsets_bprop.mindir +58 -0
- mindspore/ops/bprop_mindir/Depend_bprop.mindir +12 -13
- mindspore/ops/bprop_mindir/DepthToSpace_bprop.mindir +23 -0
- mindspore/ops/bprop_mindir/DepthwiseConv2dNative_bprop.mindir +138 -0
- mindspore/ops/bprop_mindir/DiagPart_bprop.mindir +15 -0
- mindspore/ops/bprop_mindir/Dropout2D_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Dropout3D_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/DropoutDoMask_bprop.mindir +22 -24
- mindspore/ops/bprop_mindir/DropoutGenMask_bprop.mindir +16 -14
- mindspore/ops/bprop_mindir/DropoutGrad_bprop.mindir +27 -0
- mindspore/ops/bprop_mindir/Dropout_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/DynamicGRUV2_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/DynamicRNN_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/DynamicShape_bprop.mindir +12 -12
- mindspore/ops/bprop_mindir/Elu_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/EmbeddingLookup_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Equal_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/ExpandDims_bprop.mindir +58 -0
- mindspore/ops/bprop_mindir/FastGeLU_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/Flatten_bprop.mindir +54 -0
- mindspore/ops/bprop_mindir/FloorDiv_bprop.mindir +18 -15
- mindspore/ops/bprop_mindir/GatherD_bprop.mindir +26 -0
- mindspore/ops/bprop_mindir/GatherNd_bprop.mindir +57 -0
- mindspore/ops/bprop_mindir/Gather_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/GreaterEqual_bprop.mindir +17 -18
- mindspore/ops/bprop_mindir/Greater_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/HSigmoid_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/HSwish_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/IOU_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/InstanceNorm_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/IsFinite_bprop.mindir +13 -12
- mindspore/ops/bprop_mindir/IsInf_bprop.mindir +13 -10
- mindspore/ops/bprop_mindir/IsNan_bprop.mindir +14 -11
- mindspore/ops/bprop_mindir/KLDivLoss_bprop.mindir +126 -0
- mindspore/ops/bprop_mindir/L2Loss_bprop.mindir +15 -0
- mindspore/ops/bprop_mindir/L2Normalize_bprop.mindir +30 -0
- mindspore/ops/bprop_mindir/LRN_bprop.mindir +43 -0
- mindspore/ops/bprop_mindir/LayerNormGrad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/LessEqual_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/Less_bprop.mindir +17 -18
- mindspore/ops/bprop_mindir/LinSpace_bprop.mindir +22 -19
- mindspore/ops/bprop_mindir/Load_bprop.mindir +12 -13
- mindspore/ops/bprop_mindir/LogSoftmax_bprop.mindir +23 -0
- mindspore/ops/bprop_mindir/LogicalAnd_bprop.mindir +17 -18
- mindspore/ops/bprop_mindir/LogicalNot_bprop.mindir +14 -13
- mindspore/ops/bprop_mindir/MaskedSelect_bprop.mindir +21 -0
- mindspore/ops/bprop_mindir/MaxPool3DGradGrad_bprop.mindir +74 -0
- mindspore/ops/bprop_mindir/MaxPool3DGrad_bprop.mindir +74 -0
- mindspore/ops/bprop_mindir/MaxPool3D_bprop.mindir +75 -0
- mindspore/ops/bprop_mindir/MaxPoolGradGrad_bprop.mindir +65 -0
- mindspore/ops/bprop_mindir/MaxPoolWithArgmax_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Maximum_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Minimum_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/MirrorPad_bprop.mindir +27 -0
- mindspore/ops/bprop_mindir/Mish_bprop.mindir +35 -0
- mindspore/ops/bprop_mindir/MulNoNan_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/NLLLoss_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/NonZero_bprop.mindir +14 -0
- mindspore/ops/bprop_mindir/NotEqual_bprop.mindir +18 -19
- mindspore/ops/bprop_mindir/OneHot_bprop.mindir +25 -23
- mindspore/ops/bprop_mindir/OnesLike_bprop.mindir +13 -13
- mindspore/ops/bprop_mindir/PReLU_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Pad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Padding_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/RNNTLoss_bprop.mindir +29 -0
- mindspore/ops/bprop_mindir/ROIAlign_bprop.mindir +82 -0
- mindspore/ops/bprop_mindir/Range_bprop.mindir +21 -19
- mindspore/ops/bprop_mindir/Rank_bprop.mindir +11 -11
- mindspore/ops/bprop_mindir/ReLU6_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/ReLUV2_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/ReduceAll_bprop.mindir +18 -17
- mindspore/ops/bprop_mindir/ReduceAny_bprop.mindir +18 -17
- mindspore/ops/bprop_mindir/ReluGrad_bprop.mindir +19 -23
- mindspore/ops/bprop_mindir/Reshape_bprop.mindir +60 -0
- mindspore/ops/bprop_mindir/ResizeBilinear_bprop.mindir +29 -0
- mindspore/ops/bprop_mindir/ResizeNearestNeighbor_bprop.mindir +89 -0
- mindspore/ops/bprop_mindir/ReverseSequence_bprop.mindir +52 -0
- mindspore/ops/bprop_mindir/ReverseV2_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/Round_bprop.mindir +14 -13
- mindspore/ops/bprop_mindir/ScatterMax_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/ScatterMin_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/ScatterNdUpdate_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/ScatterNd_bprop.mindir +24 -0
- mindspore/ops/bprop_mindir/ScatterNonAliasingAdd_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/ScatterUpdate_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/SeLU_bprop.mindir +21 -0
- mindspore/ops/bprop_mindir/Select_bprop.mindir +30 -34
- mindspore/ops/bprop_mindir/Shape_bprop.mindir +12 -12
- mindspore/ops/bprop_mindir/SigmoidCrossEntropyWithLogits_bprop.mindir +21 -0
- mindspore/ops/bprop_mindir/SigmoidGrad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Sigmoid_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/Sign_bprop.mindir +13 -12
- mindspore/ops/bprop_mindir/Slice_bprop.mindir +26 -0
- mindspore/ops/bprop_mindir/SmoothL1Loss_bprop.mindir +36 -0
- mindspore/ops/bprop_mindir/SoftmaxCrossEntropyWithLogits_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Softplus_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/Softsign_bprop.mindir +33 -0
- mindspore/ops/bprop_mindir/Sort_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/SpaceToBatchND_bprop.mindir +28 -0
- mindspore/ops/bprop_mindir/SpaceToDepth_bprop.mindir +23 -0
- mindspore/ops/bprop_mindir/SparseGatherV2_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/SparseSoftmaxCrossEntropyWithLogits_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Split_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/Squeeze_bprop.mindir +54 -0
- mindspore/ops/bprop_mindir/StridedSliceGrad_bprop.mindir +95 -0
- mindspore/ops/bprop_mindir/StridedSlice_bprop.mindir +98 -0
- mindspore/ops/bprop_mindir/Switch_bprop.mindir +28 -32
- mindspore/ops/bprop_mindir/TanhGrad_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Tanh_bprop.mindir +66 -0
- mindspore/ops/bprop_mindir/TensorScatterAdd_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/TensorScatterUpdate_bprop.mindir +29 -0
- mindspore/ops/bprop_mindir/TensorShape_bprop.mindir +14 -0
- mindspore/ops/bprop_mindir/Tile_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/TopK_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/TransShape_bprop.mindir +23 -0
- mindspore/ops/bprop_mindir/TruncateDiv_bprop.mindir +18 -15
- mindspore/ops/bprop_mindir/TupleGetItem_bprop.mindir +11 -13
- mindspore/ops/bprop_mindir/Unique_bprop.mindir +16 -0
- mindspore/ops/bprop_mindir/Unstack_bprop.mindir +22 -0
- mindspore/ops/bprop_mindir/UpsampleNearest3D_bprop.mindir +32 -0
- mindspore/ops/bprop_mindir/UpsampleTrilinear3D_bprop.mindir +38 -0
- mindspore/ops/bprop_mindir/ZerosLike_bprop.mindir +13 -12
- mindspore/ops/bprop_mindir/__init__.py +1 -4
- mindspore/ops/bprop_mindir/generate_mindir.py +32 -20
- mindspore/ops/composite/__init__.py +12 -13
- mindspore/ops/composite/base.py +261 -254
- mindspore/ops/composite/env_ops.py +41 -0
- mindspore/ops/composite/math_ops.py +197 -156
- mindspore/ops/composite/multitype_ops/_compile_utils.py +428 -176
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +188 -87
- mindspore/ops/composite/multitype_ops/add_impl.py +23 -1
- mindspore/ops/composite/multitype_ops/div_impl.py +3 -3
- mindspore/ops/composite/multitype_ops/equal_impl.py +1 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +1 -1
- mindspore/ops/composite/multitype_ops/getitem_impl.py +52 -5
- mindspore/ops/composite/multitype_ops/greater_equal_impl.py +31 -0
- mindspore/ops/composite/multitype_ops/greater_impl.py +31 -0
- mindspore/ops/composite/multitype_ops/in_impl.py +15 -3
- mindspore/ops/composite/multitype_ops/less_equal_impl.py +33 -2
- mindspore/ops/composite/multitype_ops/less_impl.py +33 -0
- mindspore/ops/composite/multitype_ops/logical_and_impl.py +2 -2
- mindspore/ops/composite/multitype_ops/logical_or_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/mod_impl.py +1 -1
- mindspore/ops/composite/multitype_ops/mul_impl.py +21 -7
- mindspore/ops/composite/multitype_ops/not_in_impl.py +15 -3
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +2 -4
- mindspore/ops/composite/multitype_ops/pow_impl.py +1 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +62 -70
- mindspore/ops/composite/multitype_ops/sub_impl.py +3 -3
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +41 -4
- mindspore/ops/function/__init__.py +323 -8
- mindspore/ops/function/array_func.py +3511 -780
- mindspore/ops/function/clip_func.py +329 -0
- mindspore/ops/function/debug_func.py +6 -6
- mindspore/ops/function/grad/__init__.py +5 -1
- mindspore/ops/function/grad/grad_func.py +736 -65
- mindspore/ops/function/image_func.py +270 -0
- mindspore/ops/function/linalg_func.py +268 -8
- mindspore/ops/function/math_func.py +8032 -3164
- mindspore/ops/function/nn_func.py +5619 -1855
- mindspore/ops/function/other_func.py +115 -0
- mindspore/ops/function/parameter_func.py +11 -10
- mindspore/ops/function/random_func.py +939 -77
- mindspore/ops/function/sparse_func.py +249 -84
- mindspore/ops/function/sparse_unary_func.py +2303 -0
- mindspore/ops/function/spectral_func.py +146 -0
- mindspore/ops/function/vmap_func.py +114 -0
- mindspore/ops/functional.py +182 -254
- mindspore/ops/op_info_register.py +79 -34
- mindspore/ops/operations/__init__.py +210 -118
- mindspore/ops/operations/_csr_ops.py +7 -7
- mindspore/ops/operations/_embedding_cache_ops.py +25 -15
- mindspore/ops/operations/_grad_ops.py +447 -322
- mindspore/ops/operations/_inner_ops.py +547 -176
- mindspore/ops/operations/_map_tensor_ops.py +112 -0
- mindspore/ops/operations/_ms_kernel.py +29 -27
- mindspore/ops/operations/_ocr_ops.py +11 -11
- mindspore/ops/operations/_opaque_predicate_registry.py +41 -0
- mindspore/ops/operations/_quant_ops.py +186 -101
- mindspore/ops/operations/_rl_inner_ops.py +122 -61
- mindspore/ops/operations/_scalar_ops.py +466 -0
- mindspore/ops/operations/_sequence_ops.py +1047 -0
- mindspore/ops/operations/_tensor_array.py +10 -11
- mindspore/ops/operations/_thor_ops.py +4 -4
- mindspore/ops/operations/array_ops.py +1428 -1226
- mindspore/ops/operations/comm_ops.py +180 -117
- mindspore/ops/operations/control_ops.py +4 -2
- mindspore/ops/operations/custom_ops.py +185 -98
- mindspore/ops/operations/debug_ops.py +92 -54
- mindspore/ops/operations/image_ops.py +406 -211
- mindspore/ops/operations/inner_ops.py +42 -53
- mindspore/ops/operations/linalg_ops.py +32 -29
- mindspore/ops/operations/math_ops.py +2076 -897
- mindspore/ops/operations/nn_ops.py +1282 -1252
- mindspore/ops/operations/other_ops.py +124 -278
- mindspore/ops/operations/random_ops.py +345 -178
- mindspore/ops/operations/rl_ops.py +8 -9
- mindspore/ops/operations/sparse_ops.py +502 -157
- mindspore/ops/operations/spectral_ops.py +107 -0
- mindspore/ops/primitive.py +192 -15
- mindspore/ops/vm_impl_registry.py +23 -2
- mindspore/parallel/__init__.py +6 -1
- mindspore/parallel/_auto_parallel_context.py +199 -92
- mindspore/parallel/_cell_wrapper.py +4 -2
- mindspore/parallel/_cost_model_context.py +3 -0
- mindspore/parallel/_dp_allreduce_fusion.py +2 -1
- mindspore/parallel/_offload_context.py +185 -0
- mindspore/parallel/_parallel_serialization.py +167 -28
- mindspore/parallel/_ps_context.py +9 -5
- mindspore/parallel/_recovery_context.py +1 -1
- mindspore/parallel/_tensor.py +9 -1
- mindspore/{nn/transformer → parallel/_transformer}/__init__.py +6 -6
- mindspore/{nn/transformer → parallel/_transformer}/layers.py +59 -37
- mindspore/{nn/transformer → parallel/_transformer}/loss.py +4 -7
- mindspore/{nn/transformer → parallel/_transformer}/moe.py +160 -35
- mindspore/{nn/transformer → parallel/_transformer}/op_parallel_config.py +3 -3
- mindspore/{nn/transformer → parallel/_transformer}/transformer.py +235 -196
- mindspore/parallel/_utils.py +47 -7
- mindspore/parallel/algo_parameter_config.py +5 -1
- mindspore/parallel/checkpoint_transform.py +329 -0
- mindspore/parallel/shard.py +229 -0
- mindspore/perf_msvcbuildinsights.dll +0 -0
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +2 -1
- mindspore/profiler/common/util.py +4 -3
- mindspore/profiler/common/validator/validate_path.py +2 -2
- mindspore/profiler/envprofiling.py +249 -0
- mindspore/profiler/parser/aicpu_data_parser.py +38 -39
- mindspore/profiler/parser/ascend_timeline_generator.py +497 -0
- mindspore/profiler/parser/base_timeline_generator.py +471 -0
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +684 -0
- mindspore/profiler/parser/framework_parser.py +42 -16
- mindspore/profiler/parser/hccl_parser.py +158 -158
- mindspore/profiler/parser/hwts_log_parser.py +7 -6
- mindspore/profiler/parser/integrator.py +18 -1579
- mindspore/profiler/parser/minddata_analyzer.py +8 -8
- mindspore/profiler/parser/msadvisor_analyzer.py +14 -27
- mindspore/profiler/parser/msadvisor_parser.py +2 -4
- mindspore/profiler/parser/optime_parser.py +17 -18
- mindspore/profiler/parser/profiler_info.py +108 -0
- mindspore/profiler/parser/step_trace_parser.py +1 -1
- mindspore/profiler/profiling.py +396 -194
- mindspore/rewrite/__init__.py +6 -2
- mindspore/rewrite/api/node.py +51 -110
- mindspore/rewrite/api/node_type.py +10 -6
- mindspore/rewrite/api/pattern_engine.py +51 -7
- mindspore/rewrite/api/scoped_value.py +64 -53
- mindspore/rewrite/api/symbol_tree.py +108 -61
- mindspore/rewrite/api/tree_node_helper.py +2 -3
- mindspore/{compression/quant/__init__.py → rewrite/ast_creator_register.py} +20 -11
- mindspore/rewrite/ast_helpers/__init__.py +6 -3
- mindspore/rewrite/ast_helpers/ast_creator.py +115 -0
- mindspore/rewrite/ast_helpers/ast_finder.py +99 -1
- mindspore/rewrite/ast_helpers/ast_modifier.py +17 -4
- mindspore/rewrite/ast_helpers/ast_replacer.py +1 -1
- mindspore/rewrite/ast_transformers/__init__.py +0 -1
- mindspore/rewrite/ast_transformers/flatten_recursive_stmt.py +46 -5
- mindspore/rewrite/ast_transformers/remove_return_out_of_if.py +6 -3
- mindspore/rewrite/common/__init__.py +2 -0
- mindspore/rewrite/common/event.py +1 -1
- mindspore/rewrite/common/observable.py +1 -1
- mindspore/rewrite/common/observer.py +1 -1
- mindspore/rewrite/common/rewrite_elog.py +35 -0
- mindspore/rewrite/namer.py +2 -2
- mindspore/rewrite/namespace.py +14 -4
- mindspore/rewrite/node.py +161 -13
- mindspore/rewrite/parser.py +0 -1
- mindspore/rewrite/parser_register.py +0 -1
- mindspore/rewrite/parsers/arguments_parser.py +3 -2
- mindspore/rewrite/parsers/assign_parser.py +267 -67
- mindspore/rewrite/parsers/attribute_parser.py +56 -0
- mindspore/rewrite/parsers/class_def_parser.py +191 -108
- mindspore/rewrite/parsers/constant_parser.py +101 -0
- mindspore/rewrite/parsers/container_parser.py +88 -0
- mindspore/rewrite/parsers/for_parser.py +28 -15
- mindspore/rewrite/parsers/function_def_parser.py +21 -5
- mindspore/rewrite/parsers/if_parser.py +11 -28
- mindspore/rewrite/parsers/module_parser.py +9 -6
- mindspore/rewrite/parsers/return_parser.py +3 -2
- mindspore/rewrite/sparsify/__init__.py +0 -0
- mindspore/rewrite/sparsify/sparse_transformer.py +448 -0
- mindspore/rewrite/sparsify/sparsify.py +109 -0
- mindspore/rewrite/sparsify/utils.py +173 -0
- mindspore/rewrite/symbol_tree.py +322 -109
- mindspore/rewrite/symbol_tree_builder.py +45 -8
- mindspore/rewrite/symbol_tree_dumper.py +0 -1
- mindspore/rewrite/topological_manager.py +1 -2
- mindspore/run_check/_check_version.py +209 -112
- mindspore/run_check/run_check.py +2 -1
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/__init__.py +6 -4
- mindspore/train/_utils.py +28 -5
- mindspore/train/amp.py +321 -50
- mindspore/train/callback/__init__.py +3 -1
- mindspore/train/callback/_backup_and_restore.py +120 -0
- mindspore/train/callback/_callback.py +8 -8
- mindspore/train/callback/_checkpoint.py +12 -9
- mindspore/train/callback/_early_stop.py +13 -7
- mindspore/train/callback/_history.py +8 -8
- mindspore/train/callback/_lambda_callback.py +6 -6
- mindspore/train/callback/_landscape.py +36 -38
- mindspore/train/callback/_loss_monitor.py +12 -6
- mindspore/train/callback/_lr_scheduler_callback.py +2 -4
- mindspore/train/callback/_on_request_exit.py +212 -0
- mindspore/train/callback/_reduce_lr_on_plateau.py +13 -7
- mindspore/train/callback/_summary_collector.py +27 -19
- mindspore/train/callback/_time_monitor.py +13 -7
- mindspore/train/checkpoint_pb2.py +68 -8
- mindspore/train/data_sink.py +122 -33
- mindspore/train/dataset_helper.py +28 -87
- mindspore/train/loss_scale_manager.py +4 -7
- mindspore/{nn → train}/metrics/__init__.py +20 -20
- mindspore/{nn → train}/metrics/accuracy.py +12 -10
- mindspore/{nn → train}/metrics/auc.py +4 -4
- mindspore/{nn → train}/metrics/bleu_score.py +4 -4
- mindspore/{nn → train}/metrics/confusion_matrix.py +10 -8
- mindspore/{nn → train}/metrics/cosine_similarity.py +4 -4
- mindspore/{nn → train}/metrics/dice.py +6 -5
- mindspore/{nn → train}/metrics/error.py +7 -5
- mindspore/{nn → train}/metrics/fbeta.py +9 -7
- mindspore/{nn → train}/metrics/hausdorff_distance.py +8 -6
- mindspore/{nn → train}/metrics/loss.py +4 -3
- mindspore/{nn → train}/metrics/mean_surface_distance.py +6 -5
- mindspore/{nn → train}/metrics/metric.py +6 -5
- mindspore/{nn → train}/metrics/occlusion_sensitivity.py +4 -3
- mindspore/{nn → train}/metrics/perplexity.py +5 -4
- mindspore/{nn → train}/metrics/precision.py +5 -4
- mindspore/{nn → train}/metrics/recall.py +5 -4
- mindspore/{nn → train}/metrics/roc.py +7 -6
- mindspore/{nn → train}/metrics/root_mean_square_surface_distance.py +6 -5
- mindspore/{nn → train}/metrics/topk.py +7 -5
- mindspore/train/mind_ir_pb2.py +339 -32
- mindspore/train/model.py +113 -84
- mindspore/train/serialization.py +547 -167
- mindspore/train/summary/_summary_adapter.py +1 -1
- mindspore/train/summary/summary_record.py +43 -12
- mindspore/train/train_thor/convert_utils.py +7 -1
- mindspore/train/train_thor/dataset_helper.py +3 -3
- mindspore/train/train_thor/model_thor.py +0 -4
- mindspore/turbojpeg.dll +0 -0
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-1.10.0.dist-info → mindspore-2.0.0rc1.dist-info}/METADATA +4 -3
- {mindspore-1.10.0.dist-info → mindspore-2.0.0rc1.dist-info}/RECORD +901 -660
- mindspore/compression/common/constant.py +0 -124
- mindspore/compression/export/__init__.py +0 -19
- mindspore/compression/export/quant_export.py +0 -514
- mindspore/compression/quant/qat.py +0 -636
- mindspore/compression/quant/quant_utils.py +0 -462
- mindspore/compression/quant/quantizer.py +0 -68
- mindspore/libatomic-1.dll +0 -0
- mindspore/libgcc_s_seh-1.dll +0 -0
- mindspore/libgfortran-4.dll +0 -0
- mindspore/libgomp-1.dll +0 -0
- mindspore/libjpeg-62.dll +0 -0
- mindspore/libmindspore.dll +0 -0
- mindspore/libmindspore_common.dll +0 -0
- mindspore/libmindspore_core.dll +0 -0
- mindspore/libmindspore_glog.dll +0 -0
- mindspore/libnnacl.dll +0 -0
- mindspore/libopencv_core452.dll +0 -0
- mindspore/libopencv_imgcodecs452.dll +0 -0
- mindspore/libopencv_imgproc452.dll +0 -0
- mindspore/libquadmath-0.dll +0 -0
- mindspore/libsqlite3.dll +0 -0
- mindspore/libssp-0.dll +0 -0
- mindspore/libstdc++-6.dll +0 -0
- mindspore/libtinyxml2.dll +0 -0
- mindspore/libturbojpeg.dll +0 -0
- mindspore/libwinpthread-1.dll +0 -0
- mindspore/nn/layer/quant.py +0 -1868
- mindspore/nn/layer/rnn_utils.py +0 -90
- mindspore/nn/probability/dpn/__init__.py +0 -22
- mindspore/nn/probability/dpn/vae/__init__.py +0 -25
- mindspore/nn/probability/dpn/vae/cvae.py +0 -138
- mindspore/nn/probability/dpn/vae/vae.py +0 -122
- mindspore/nn/probability/infer/__init__.py +0 -22
- mindspore/nn/probability/infer/variational/elbo.py +0 -70
- mindspore/nn/probability/infer/variational/svi.py +0 -84
- mindspore/nn/probability/toolbox/__init__.py +0 -22
- mindspore/nn/probability/toolbox/anomaly_detection.py +0 -99
- mindspore/nn/probability/toolbox/uncertainty_evaluation.py +0 -363
- mindspore/nn/probability/transforms/__init__.py +0 -22
- mindspore/nn/probability/transforms/transform_bnn.py +0 -262
- mindspore/nn/probability/zhusuan/__init__.py +0 -18
- mindspore/nn/probability/zhusuan/framework/__init__.py +0 -18
- mindspore/nn/probability/zhusuan/framework/bn.py +0 -95
- mindspore/nn/probability/zhusuan/variational/__init__.py +0 -18
- mindspore/nn/probability/zhusuan/variational/elbo.py +0 -46
- mindspore/ops/_op_impl/tbe/bias_add_grad_ds.py +0 -52
- mindspore/ops/_op_impl/tbe/scatter_nd_add_ds.py +0 -43
- mindspore/ops/bprop_mindir/AssignAdd_bprop.mindir +0 -20
- mindspore/ops/bprop_mindir/Identity_bprop.mindir +0 -9
- mindspore/ops/bprop_mindir/LogicalOr_bprop.mindir +0 -20
- mindspore/ops/bprop_mindir/ReLU_bprop.mindir +0 -16
- mindspore/ops/bprop_mindir/UpdateState_bprop.mindir +0 -17
- mindspore/ops/bprop_mindir/stop_gradient_bprop.mindir +0 -12
- mindspore/ops/composite/array_ops.py +0 -210
- mindspore/ops/composite/clip_ops.py +0 -238
- mindspore/ops/composite/random_ops.py +0 -426
- mindspore/ops/composite/vmap_ops.py +0 -38
- mindspore/ops/operations/sponge_ops.py +0 -3531
- mindspore/ops/operations/sponge_update_ops.py +0 -2546
- mindspore/parallel/nn/__init__.py +0 -42
- mindspore/parallel/nn/loss.py +0 -22
- mindspore/parallel/nn/moe.py +0 -21
- mindspore/parallel/nn/op_parallel_config.py +0 -22
- mindspore/parallel/nn/transformer.py +0 -31
- mindspore/run_check/_check_deps_version.py +0 -84
- {mindspore-1.10.0.dist-info → mindspore-2.0.0rc1.dist-info}/WHEEL +0 -0
- {mindspore-1.10.0.dist-info → mindspore-2.0.0rc1.dist-info}/entry_points.txt +0 -0
- {mindspore-1.10.0.dist-info → mindspore-2.0.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -151,7 +151,7 @@ class AdjustGamma(ImageTensorOperation):
|
|
|
151
151
|
The output image pixel value is exponentially related to the input image pixel value.
|
|
152
152
|
gamma larger than 1 make the shadows darker,
|
|
153
153
|
while gamma smaller than 1 make dark regions lighter.
|
|
154
|
-
gain (float, optional): The constant multiplier
|
|
154
|
+
gain (float, optional): The constant multiplier. Default: 1.0.
|
|
155
155
|
|
|
156
156
|
Raises:
|
|
157
157
|
TypeError: If `gain` is not of type float.
|
|
@@ -181,12 +181,12 @@ class AdjustGamma(ImageTensorOperation):
|
|
|
181
181
|
class AutoAugment(ImageTensorOperation):
|
|
182
182
|
"""
|
|
183
183
|
Apply AutoAugment data augmentation method based on
|
|
184
|
-
`AutoAugment: Learning Augmentation Strategies from Data <https://arxiv.org/pdf/1805.09501.pdf>`_.
|
|
184
|
+
`AutoAugment: Learning Augmentation Strategies from Data <https://arxiv.org/pdf/1805.09501.pdf>`_ .
|
|
185
185
|
This operation works only with 3-channel RGB images.
|
|
186
186
|
|
|
187
187
|
Args:
|
|
188
|
-
policy (AutoAugmentPolicy, optional): AutoAugment policies learned on different datasets
|
|
189
|
-
|
|
188
|
+
policy (AutoAugmentPolicy, optional): AutoAugment policies learned on different datasets.
|
|
189
|
+
Default: AutoAugmentPolicy.IMAGENET.
|
|
190
190
|
It can be any of [AutoAugmentPolicy.IMAGENET, AutoAugmentPolicy.CIFAR10, AutoAugmentPolicy.SVHN].
|
|
191
191
|
Randomly apply 2 operations from a candidate set. See auto augmentation details in AutoAugmentPolicy.
|
|
192
192
|
|
|
@@ -196,7 +196,7 @@ class AutoAugment(ImageTensorOperation):
|
|
|
196
196
|
|
|
197
197
|
- AutoAugmentPolicy.SVHN, means to apply AutoAugment learned on SVHN dataset.
|
|
198
198
|
|
|
199
|
-
interpolation (Inter, optional): Image interpolation mode for Resize
|
|
199
|
+
interpolation (Inter, optional): Image interpolation mode for Resize operation. Default: Inter.NEAREST.
|
|
200
200
|
It can be any of [Inter.NEAREST, Inter.BILINEAR, Inter.BICUBIC, Inter.AREA].
|
|
201
201
|
|
|
202
202
|
- Inter.NEAREST: means interpolation method is nearest-neighbor interpolation.
|
|
@@ -205,12 +205,12 @@ class AutoAugment(ImageTensorOperation):
|
|
|
205
205
|
|
|
206
206
|
- Inter.BICUBIC: means the interpolation method is bicubic interpolation.
|
|
207
207
|
|
|
208
|
-
- Inter.AREA: means the interpolation method is area interpolation.
|
|
208
|
+
- Inter.AREA: means the interpolation method is pixel area interpolation.
|
|
209
209
|
|
|
210
210
|
fill_value (Union[int, tuple], optional): Pixel fill value for the area outside the transformed image.
|
|
211
211
|
It can be an int or a 3-tuple. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
212
|
-
If it is an integer, it is used for all RGB channels. The fill_value values must be in range [0, 255]
|
|
213
|
-
|
|
212
|
+
If it is an integer, it is used for all RGB channels. The fill_value values must be in range [0, 255].
|
|
213
|
+
Default: 0.
|
|
214
214
|
|
|
215
215
|
Raises:
|
|
216
216
|
TypeError: If `policy` is not of type AutoAugmentPolicy.
|
|
@@ -247,14 +247,14 @@ class AutoAugment(ImageTensorOperation):
|
|
|
247
247
|
|
|
248
248
|
class AutoContrast(ImageTensorOperation):
|
|
249
249
|
"""
|
|
250
|
-
Apply automatic contrast on input image. This
|
|
250
|
+
Apply automatic contrast on input image. This operation calculates histogram of image, reassign cutoff percent
|
|
251
251
|
of the lightest pixels from histogram to 255, and reassign cutoff percent of the darkest pixels from histogram to 0.
|
|
252
252
|
|
|
253
253
|
Args:
|
|
254
254
|
cutoff (float, optional): Percent of lightest and darkest pixels to cut off from
|
|
255
|
-
the histogram of input image. The value must be in the range [0.0, 50.0)
|
|
255
|
+
the histogram of input image. The value must be in the range [0.0, 50.0). Default: 0.0.
|
|
256
256
|
ignore (Union[int, sequence], optional): The background pixel values to ignore,
|
|
257
|
-
The ignore values must be in range [0, 255]
|
|
257
|
+
The ignore values must be in range [0, 255]. Default: None.
|
|
258
258
|
|
|
259
259
|
Raises:
|
|
260
260
|
TypeError: If `cutoff` is not of type float.
|
|
@@ -294,11 +294,11 @@ class BoundingBoxAugment(ImageTensorOperation):
|
|
|
294
294
|
transform (TensorOperation): C++ transformation operation to be applied on random selection
|
|
295
295
|
of bounding box regions of a given image.
|
|
296
296
|
ratio (float, optional): Ratio of bounding boxes to apply augmentation on.
|
|
297
|
-
Range: [0.0, 1.0]
|
|
297
|
+
Range: [0.0, 1.0]. Default: 0.3.
|
|
298
298
|
|
|
299
299
|
Raises:
|
|
300
300
|
TypeError: If `transform` is not an image processing operation
|
|
301
|
-
in :class:`mindspore.dataset.vision.c_transforms
|
|
301
|
+
in :class:`mindspore.dataset.vision.c_transforms` .
|
|
302
302
|
TypeError: If `ratio` is not of type float.
|
|
303
303
|
ValueError: If `ratio` is not in range [0.0, 1.0].
|
|
304
304
|
RuntimeError: If given bounding box is invalid.
|
|
@@ -312,8 +312,7 @@ class BoundingBoxAugment(ImageTensorOperation):
|
|
|
312
312
|
>>> # map to apply ops
|
|
313
313
|
>>> image_folder_dataset = image_folder_dataset.map(operations=[bbox_aug_op],
|
|
314
314
|
... input_columns=["image", "bbox"],
|
|
315
|
-
... output_columns=["image", "bbox"]
|
|
316
|
-
... column_order=["image", "bbox"])
|
|
315
|
+
... output_columns=["image", "bbox"])
|
|
317
316
|
"""
|
|
318
317
|
|
|
319
318
|
@deprecated_c_vision()
|
|
@@ -344,7 +343,7 @@ class CenterCrop(ImageTensorOperation):
|
|
|
344
343
|
Raises:
|
|
345
344
|
TypeError: If `size` is not of type int or sequence.
|
|
346
345
|
ValueError: If `size` is less than or equal to 0.
|
|
347
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
346
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
348
347
|
|
|
349
348
|
Supported Platforms:
|
|
350
349
|
``CPU``
|
|
@@ -419,7 +418,7 @@ class ConvertColor(ImageTensorOperation):
|
|
|
419
418
|
- ConvertMode.COLOR_RGBA2GRAY, Convert RGBA image to GRAY image.
|
|
420
419
|
|
|
421
420
|
Raises:
|
|
422
|
-
TypeError: If `convert_mode` is not of type :class:`mindspore.dataset.vision.c_transforms.ConvertMode
|
|
421
|
+
TypeError: If `convert_mode` is not of type :class:`mindspore.dataset.vision.c_transforms.ConvertMode` .
|
|
423
422
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
424
423
|
|
|
425
424
|
Supported Platforms:
|
|
@@ -491,16 +490,16 @@ class Crop(ImageTensorOperation):
|
|
|
491
490
|
class CutMixBatch(ImageTensorOperation):
|
|
492
491
|
"""
|
|
493
492
|
Apply CutMix transformation on input batch of images and labels.
|
|
494
|
-
Note that you need to make labels into one-hot format and batched before calling this
|
|
493
|
+
Note that you need to make labels into one-hot format and batched before calling this operation.
|
|
495
494
|
|
|
496
495
|
Args:
|
|
497
496
|
image_batch_format (ImageBatchFormat): The method of padding. Can be any of
|
|
498
497
|
[ImageBatchFormat.NHWC, ImageBatchFormat.NCHW].
|
|
499
|
-
alpha (float, optional): Hyperparameter of beta distribution, must be larger than 0
|
|
500
|
-
prob (float, optional): The probability by which CutMix is applied to each image, range: [0, 1]
|
|
498
|
+
alpha (float, optional): Hyperparameter of beta distribution, must be larger than 0. Default: 1.0.
|
|
499
|
+
prob (float, optional): The probability by which CutMix is applied to each image, range: [0, 1]. Default: 1.0.
|
|
501
500
|
|
|
502
501
|
Raises:
|
|
503
|
-
TypeError: If `image_batch_format` is not of type :class:`mindspore.dataset.vision.ImageBatchFormat
|
|
502
|
+
TypeError: If `image_batch_format` is not of type :class:`mindspore.dataset.vision.ImageBatchFormat` .
|
|
504
503
|
TypeError: If `alpha` is not of type float.
|
|
505
504
|
TypeError: If `prob` is not of type float.
|
|
506
505
|
ValueError: If `alpha` is less than or equal 0.
|
|
@@ -538,7 +537,7 @@ class CutOut(ImageTensorOperation):
|
|
|
538
537
|
|
|
539
538
|
Args:
|
|
540
539
|
length (int): The side length of each square patch, must be larger than 0.
|
|
541
|
-
num_patches (int, optional): Number of patches to be cut out of an image, must be larger than 0.
|
|
540
|
+
num_patches (int, optional): Number of patches to be cut out of an image, must be larger than 0. Default: 1.
|
|
542
541
|
|
|
543
542
|
Raises:
|
|
544
543
|
TypeError: If `length` is not of type int.
|
|
@@ -571,7 +570,7 @@ class Decode(ImageTensorOperation):
|
|
|
571
570
|
Decode the input image.
|
|
572
571
|
|
|
573
572
|
Args:
|
|
574
|
-
rgb (bool, optional): Mode of decoding input image
|
|
573
|
+
rgb (bool, optional): Mode of decoding input image. Default: True.
|
|
575
574
|
If True means format of decoded image is RGB else BGR (deprecated).
|
|
576
575
|
|
|
577
576
|
Raises:
|
|
@@ -644,8 +643,8 @@ class GaussianBlur(ImageTensorOperation):
|
|
|
644
643
|
kernel_size (Union[int, Sequence[int]]): Size of the Gaussian kernel to use. The value must be positive and odd.
|
|
645
644
|
If only an integer is provided, the kernel size will be (kernel_size, kernel_size). If a sequence of integer
|
|
646
645
|
is provided, it must be a sequence of 2 values which represents (width, height).
|
|
647
|
-
sigma (Union[float, Sequence[float]], optional): Standard deviation of the Gaussian kernel to use
|
|
648
|
-
|
|
646
|
+
sigma (Union[float, Sequence[float]], optional): Standard deviation of the Gaussian kernel to use.
|
|
647
|
+
Default: None. The value must be positive. If only a float is provided, the sigma will be (sigma, sigma).
|
|
649
648
|
If a sequence of float is provided, it must be a sequence of 2 values which represents (width, height).
|
|
650
649
|
If None is provided, the sigma will be calculated as ((kernel_size - 1) * 0.5 - 1) * 0.3 + 0.8.
|
|
651
650
|
|
|
@@ -686,7 +685,7 @@ class HorizontalFlip(ImageTensorOperation):
|
|
|
686
685
|
Flip the input image horizontally.
|
|
687
686
|
|
|
688
687
|
Raises:
|
|
689
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
688
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
690
689
|
|
|
691
690
|
Supported Platforms:
|
|
692
691
|
``CPU``
|
|
@@ -717,7 +716,7 @@ class HWC2CHW(ImageTensorOperation):
|
|
|
717
716
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
718
717
|
|
|
719
718
|
Supported Platforms:
|
|
720
|
-
``
|
|
719
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
721
720
|
|
|
722
721
|
Examples:
|
|
723
722
|
>>> transforms_list = [c_vision.Decode(),
|
|
@@ -738,7 +737,7 @@ class HWC2CHW(ImageTensorOperation):
|
|
|
738
737
|
|
|
739
738
|
class Invert(ImageTensorOperation):
|
|
740
739
|
"""
|
|
741
|
-
Apply invert on input image in RGB mode. This
|
|
740
|
+
Apply invert on input image in RGB mode. This operation will reassign every pixel to (255 - pixel).
|
|
742
741
|
|
|
743
742
|
Raises:
|
|
744
743
|
RuntimeError: If given tensor shape is not <H, W, C>.
|
|
@@ -769,10 +768,10 @@ class MixUpBatch(ImageTensorOperation):
|
|
|
769
768
|
The lambda is generated based on the specified alpha value. Two coefficients x1, x2 are randomly generated
|
|
770
769
|
in the range [alpha, 1], and lambda = (x1 / (x1 + x2)).
|
|
771
770
|
|
|
772
|
-
Note that you need to make labels into one-hot format and batched before calling this
|
|
771
|
+
Note that you need to make labels into one-hot format and batched before calling this operation.
|
|
773
772
|
|
|
774
773
|
Args:
|
|
775
|
-
alpha (float, optional): Hyperparameter of beta distribution. The value must be positive
|
|
774
|
+
alpha (float, optional): Hyperparameter of beta distribution. The value must be positive. Default: 1.0.
|
|
776
775
|
|
|
777
776
|
Raises:
|
|
778
777
|
TypeError: If `alpha` is not of type float.
|
|
@@ -803,7 +802,7 @@ class MixUpBatch(ImageTensorOperation):
|
|
|
803
802
|
|
|
804
803
|
class Normalize(ImageTensorOperation):
|
|
805
804
|
"""
|
|
806
|
-
Normalize the input image with respect to mean and standard deviation. This
|
|
805
|
+
Normalize the input image with respect to mean and standard deviation. This operation will normalize
|
|
807
806
|
the input image with: output[channel] = (input[channel] - mean[channel]) / std[channel], where channel >= 1.
|
|
808
807
|
|
|
809
808
|
Note:
|
|
@@ -823,7 +822,7 @@ class Normalize(ImageTensorOperation):
|
|
|
823
822
|
RuntimeError: If given tensor shape is not <H, W> or <...,H, W, C>.
|
|
824
823
|
|
|
825
824
|
Supported Platforms:
|
|
826
|
-
``
|
|
825
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
827
826
|
|
|
828
827
|
Examples:
|
|
829
828
|
>>> decode_op = c_vision.Decode()
|
|
@@ -852,7 +851,7 @@ class NormalizePad(ImageTensorOperation):
|
|
|
852
851
|
The mean values must be in range (0.0, 255.0].
|
|
853
852
|
std (sequence): List or tuple of standard deviations for each channel, with respect to channel order.
|
|
854
853
|
The standard deviation values must be in range (0.0, 255.0].
|
|
855
|
-
dtype (str, optional): Set the dtype of the output image
|
|
854
|
+
dtype (str, optional): Set the dtype of the output image. Default: "float32".
|
|
856
855
|
|
|
857
856
|
Raises:
|
|
858
857
|
TypeError: If `mean` is not of type sequence.
|
|
@@ -900,8 +899,8 @@ class Pad(ImageTensorOperation):
|
|
|
900
899
|
fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
|
|
901
900
|
padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
902
901
|
If it is an integer, it is used for all RGB channels.
|
|
903
|
-
The fill_value values must be in range [0, 255]
|
|
904
|
-
padding_mode (Border, optional): The method of padding
|
|
902
|
+
The fill_value values must be in range [0, 255]. Default: 0.
|
|
903
|
+
padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. Can be any of
|
|
905
904
|
[Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
|
|
906
905
|
|
|
907
906
|
- Border.CONSTANT, means it fills the border with constant values.
|
|
@@ -923,7 +922,7 @@ class Pad(ImageTensorOperation):
|
|
|
923
922
|
Raises:
|
|
924
923
|
TypeError: If `padding` is not of type int or Sequence[int].
|
|
925
924
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
926
|
-
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border
|
|
925
|
+
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border` .
|
|
927
926
|
ValueError: If `padding` is negative.
|
|
928
927
|
ValueError: If `fill_value` is not in range [0, 255].
|
|
929
928
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
@@ -960,7 +959,7 @@ class RandomAdjustSharpness(ImageTensorOperation):
|
|
|
960
959
|
Degree of 0.0 gives a blurred image, degree of 1.0 gives the original image,
|
|
961
960
|
and degree of 2.0 increases the sharpness by a factor of 2.
|
|
962
961
|
prob (float, optional): Probability of the image being sharpness adjusted, which
|
|
963
|
-
must be in range of [0, 1]
|
|
962
|
+
must be in range of [0, 1]. Default: 0.5.
|
|
964
963
|
|
|
965
964
|
Raises:
|
|
966
965
|
TypeError: If `degree` is not of type float.
|
|
@@ -997,7 +996,7 @@ class RandomAffine(ImageTensorOperation):
|
|
|
997
996
|
If `degrees` is a number, the range will be (-degrees, degrees).
|
|
998
997
|
If `degrees` is a sequence, it should be (min, max).
|
|
999
998
|
translate (sequence, optional): Sequence (tx_min, tx_max, ty_min, ty_max) of minimum/maximum translation in
|
|
1000
|
-
x(horizontal) and y(vertical) directions, range [-1.0, 1.0]
|
|
999
|
+
x(horizontal) and y(vertical) directions, range [-1.0, 1.0]. Default: None.
|
|
1001
1000
|
The horizontal and vertical shift is selected randomly from the range:
|
|
1002
1001
|
(tx_min*width, tx_max*width) and (ty_min*height, ty_max*height), respectively.
|
|
1003
1002
|
If a tuple or list of size 2, then a translate parallel to the X axis in the range of
|
|
@@ -1006,16 +1005,16 @@ class RandomAffine(ImageTensorOperation):
|
|
|
1006
1005
|
(translate[0], translate[1]) and a translate parallel to the Y axis in the range of
|
|
1007
1006
|
(translate[2], translate[3]) are applied.
|
|
1008
1007
|
If None, no translation is applied.
|
|
1009
|
-
scale (sequence, optional): Scaling factor interval, which must be non negative
|
|
1010
|
-
|
|
1011
|
-
shear (Union[int, float, sequence], optional): Range of shear factor, which must be positive
|
|
1008
|
+
scale (sequence, optional): Scaling factor interval, which must be non negative.
|
|
1009
|
+
Default: None, original scale is used.
|
|
1010
|
+
shear (Union[int, float, sequence], optional): Range of shear factor, which must be positive. Default: None.
|
|
1012
1011
|
If a number, then a shear parallel to the X axis in the range of (-shear, +shear) is applied.
|
|
1013
1012
|
If a tuple or list of size 2, then a shear parallel to the X axis in the range of (shear[0], shear[1])
|
|
1014
1013
|
is applied.
|
|
1015
1014
|
If a tuple or list of size 4, then a shear parallel to X axis in the range of (shear[0], shear[1])
|
|
1016
1015
|
and a shear parallel to Y axis in the range of (shear[2], shear[3]) is applied.
|
|
1017
1016
|
If None, no shear is applied.
|
|
1018
|
-
resample (Inter, optional): An optional resampling filter
|
|
1017
|
+
resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
|
|
1019
1018
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA].
|
|
1020
1019
|
|
|
1021
1020
|
- Inter.BILINEAR, means resample method is bilinear interpolation.
|
|
@@ -1028,14 +1027,14 @@ class RandomAffine(ImageTensorOperation):
|
|
|
1028
1027
|
|
|
1029
1028
|
fill_value (Union[int, tuple[int]], optional): Optional fill_value to fill the area outside the transform
|
|
1030
1029
|
in the output image. There must be three elements in tuple and the value of single element is [0, 255].
|
|
1031
|
-
|
|
1030
|
+
Default: 0, filling is performed.
|
|
1032
1031
|
|
|
1033
1032
|
Raises:
|
|
1034
1033
|
TypeError: If `degrees` is not of type int, float or sequence.
|
|
1035
1034
|
TypeError: If `translate` is not of type sequence.
|
|
1036
1035
|
TypeError: If `scale` is not of type sequence.
|
|
1037
1036
|
TypeError: If `shear` is not of type int, float or sequence.
|
|
1038
|
-
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter
|
|
1037
|
+
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
1039
1038
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
1040
1039
|
ValueError: If `degrees` is negative.
|
|
1041
1040
|
ValueError: If `translate` is not in range [-1.0, 1.0].
|
|
@@ -1107,11 +1106,11 @@ class RandomAutoContrast(ImageTensorOperation):
|
|
|
1107
1106
|
|
|
1108
1107
|
Args:
|
|
1109
1108
|
cutoff (float, optional): Percent of the lightest and darkest pixels to be cut off from
|
|
1110
|
-
the histogram of the input image. The value must be in range of [0.0, 50.0)
|
|
1109
|
+
the histogram of the input image. The value must be in range of [0.0, 50.0). Default: 0.0.
|
|
1111
1110
|
ignore (Union[int, sequence], optional): The background pixel values to be ignored, each of
|
|
1112
|
-
which must be in range of [0, 255]
|
|
1111
|
+
which must be in range of [0, 255]. Default: None.
|
|
1113
1112
|
prob (float, optional): Probability of the image being automatically contrasted, which
|
|
1114
|
-
must be in range of [0, 1]
|
|
1113
|
+
must be in range of [0, 1]. Default: 0.5.
|
|
1115
1114
|
|
|
1116
1115
|
Raises:
|
|
1117
1116
|
TypeError: If `cutoff` is not of type float.
|
|
@@ -1154,7 +1153,7 @@ class RandomColor(ImageTensorOperation):
|
|
|
1154
1153
|
Args:
|
|
1155
1154
|
degrees (Sequence[float], optional): Range of random color adjustment degrees, which must be non-negative.
|
|
1156
1155
|
It should be in (min, max) format. If min=max, then it is a
|
|
1157
|
-
single fixed magnitude operation (
|
|
1156
|
+
single fixed magnitude operation. Default: (0.1, 1.9).
|
|
1158
1157
|
|
|
1159
1158
|
Raises:
|
|
1160
1159
|
TypeError: If `degrees` is not of type Sequence[float].
|
|
@@ -1187,19 +1186,19 @@ class RandomColorAdjust(ImageTensorOperation):
|
|
|
1187
1186
|
This operation supports running on Ascend or GPU platforms by Offload.
|
|
1188
1187
|
|
|
1189
1188
|
Args:
|
|
1190
|
-
brightness (Union[float, Sequence[float]], optional): Brightness adjustment factor (
|
|
1189
|
+
brightness (Union[float, Sequence[float]], optional): Brightness adjustment factor. Default: (1, 1).
|
|
1191
1190
|
Cannot be negative.
|
|
1192
1191
|
If it is a float, the factor is uniformly chosen from the range [max(0, 1-brightness), 1+brightness].
|
|
1193
1192
|
If it is a sequence, it should be [min, max] for the range.
|
|
1194
|
-
contrast (Union[float, Sequence[float]], optional): Contrast adjustment factor (
|
|
1193
|
+
contrast (Union[float, Sequence[float]], optional): Contrast adjustment factor. Default: (1, 1).
|
|
1195
1194
|
Cannot be negative.
|
|
1196
1195
|
If it is a float, the factor is uniformly chosen from the range [max(0, 1-contrast), 1+contrast].
|
|
1197
1196
|
If it is a sequence, it should be [min, max] for the range.
|
|
1198
|
-
saturation (Union[float, Sequence[float]], optional): Saturation adjustment factor (
|
|
1197
|
+
saturation (Union[float, Sequence[float]], optional): Saturation adjustment factor. Default: (1, 1).
|
|
1199
1198
|
Cannot be negative.
|
|
1200
1199
|
If it is a float, the factor is uniformly chosen from the range [max(0, 1-saturation), 1+saturation].
|
|
1201
1200
|
If it is a sequence, it should be [min, max] for the range.
|
|
1202
|
-
hue (Union[float, Sequence[float]], optional): Hue adjustment factor (
|
|
1201
|
+
hue (Union[float, Sequence[float]], optional): Hue adjustment factor. Default: (0, 0).
|
|
1203
1202
|
If it is a float, the range will be [-hue, hue]. Value should be 0 <= hue <= 0.5.
|
|
1204
1203
|
If it is a sequence, it should be [min, max] where -0.5 <= min <= max <= 0.5.
|
|
1205
1204
|
|
|
@@ -1215,7 +1214,7 @@ class RandomColorAdjust(ImageTensorOperation):
|
|
|
1215
1214
|
RuntimeError: If given tensor shape is not <H, W, C>.
|
|
1216
1215
|
|
|
1217
1216
|
Supported Platforms:
|
|
1218
|
-
``
|
|
1217
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
1219
1218
|
|
|
1220
1219
|
Examples:
|
|
1221
1220
|
>>> decode_op = c_vision.Decode()
|
|
@@ -1267,7 +1266,7 @@ class RandomCrop(ImageTensorOperation):
|
|
|
1267
1266
|
If size is an integer, a square crop of size (size, size) is returned.
|
|
1268
1267
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
1269
1268
|
padding (Union[int, Sequence[int]], optional): The number of pixels to pad each border of the image.
|
|
1270
|
-
The padding value(s) must be non-negative
|
|
1269
|
+
The padding value(s) must be non-negative. Default: None.
|
|
1271
1270
|
If padding is not None, pad image first with padding values.
|
|
1272
1271
|
If a single number is provided, pad all borders with this value.
|
|
1273
1272
|
If a tuple or lists of 2 values are provided, pad the (left and top)
|
|
@@ -1275,12 +1274,12 @@ class RandomCrop(ImageTensorOperation):
|
|
|
1275
1274
|
If 4 values are provided as a list or tuple,
|
|
1276
1275
|
pad the left, top, right and bottom respectively.
|
|
1277
1276
|
pad_if_needed (bool, optional): Pad the image if either side is smaller than
|
|
1278
|
-
the given output size
|
|
1277
|
+
the given output size. Default: False.
|
|
1279
1278
|
fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
|
|
1280
1279
|
padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
1281
1280
|
If it is an integer, it is used for all RGB channels.
|
|
1282
|
-
The fill_value values must be in range [0, 255]
|
|
1283
|
-
padding_mode (Border, optional): The method of padding
|
|
1281
|
+
The fill_value values must be in range [0, 255]. Default: 0.
|
|
1282
|
+
padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. It can be any of
|
|
1284
1283
|
[Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
|
|
1285
1284
|
|
|
1286
1285
|
- Border.CONSTANT, means it fills the border with constant values.
|
|
@@ -1304,11 +1303,11 @@ class RandomCrop(ImageTensorOperation):
|
|
|
1304
1303
|
TypeError: If `padding` is not of type int or Sequence[int].
|
|
1305
1304
|
TypeError: If `pad_if_needed` is not of type boolean.
|
|
1306
1305
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
1307
|
-
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border
|
|
1306
|
+
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border` .
|
|
1308
1307
|
ValueError: If `size` is not positive.
|
|
1309
1308
|
ValueError: If `padding` is negative.
|
|
1310
1309
|
ValueError: If `fill_value` is not in range [0, 255].
|
|
1311
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
1310
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
1312
1311
|
|
|
1313
1312
|
Supported Platforms:
|
|
1314
1313
|
``CPU``
|
|
@@ -1347,7 +1346,7 @@ class RandomCrop(ImageTensorOperation):
|
|
|
1347
1346
|
|
|
1348
1347
|
class RandomCropDecodeResize(ImageTensorOperation):
|
|
1349
1348
|
"""
|
|
1350
|
-
A combination of `Crop
|
|
1349
|
+
A combination of `Crop` , `Decode` and `Resize` . It will get better performance for JPEG images. This operation
|
|
1351
1350
|
will crop the input image at a random location, decode the cropped image in RGB mode, and resize the decoded image.
|
|
1352
1351
|
|
|
1353
1352
|
Args:
|
|
@@ -1355,10 +1354,10 @@ class RandomCropDecodeResize(ImageTensorOperation):
|
|
|
1355
1354
|
If size is an integer, a square crop of size (size, size) is returned.
|
|
1356
1355
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
1357
1356
|
scale (Union[list, tuple], optional): Range [min, max) of respective size of the
|
|
1358
|
-
original size to be cropped, which must be non-negative (
|
|
1357
|
+
original size to be cropped, which must be non-negative. Default: (0.08, 1.0).
|
|
1359
1358
|
ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
|
|
1360
|
-
cropped, which must be non-negative (
|
|
1361
|
-
interpolation (Inter, optional): Image interpolation mode for resize
|
|
1359
|
+
cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
|
|
1360
|
+
interpolation (Inter, optional): Image interpolation mode for resize operation. Default: Inter.BILINEAR.
|
|
1362
1361
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
|
|
1363
1362
|
|
|
1364
1363
|
- Inter.BILINEAR, means interpolation method is bilinear interpolation.
|
|
@@ -1372,14 +1371,14 @@ class RandomCropDecodeResize(ImageTensorOperation):
|
|
|
1372
1371
|
- Inter.PILCUBIC, means interpolation method is bicubic interpolation like implemented in pillow, input
|
|
1373
1372
|
should be in 3 channels format.
|
|
1374
1373
|
|
|
1375
|
-
max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area
|
|
1374
|
+
max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: 10.
|
|
1376
1375
|
If exceeded, fall back to use center_crop instead. The max_attempts value must be positive.
|
|
1377
1376
|
|
|
1378
1377
|
Raises:
|
|
1379
1378
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
1380
1379
|
TypeError: If `scale` is not of type tuple or list.
|
|
1381
1380
|
TypeError: If `ratio` is not of type tuple or list.
|
|
1382
|
-
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter
|
|
1381
|
+
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
1383
1382
|
TypeError: If `max_attempts` is not of type int.
|
|
1384
1383
|
ValueError: If `size` is not positive.
|
|
1385
1384
|
ValueError: If `scale` is negative.
|
|
@@ -1437,19 +1436,19 @@ class RandomCropWithBBox(ImageTensorOperation):
|
|
|
1437
1436
|
If size is an integer, a square crop of size (size, size) is returned.
|
|
1438
1437
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
1439
1438
|
padding (Union[int, Sequence[int]], optional): The number of pixels to pad the image
|
|
1440
|
-
The padding value(s) must be non-negative
|
|
1439
|
+
The padding value(s) must be non-negative. Default: None.
|
|
1441
1440
|
If padding is not None, first pad image with padding values.
|
|
1442
1441
|
If a single number is provided, pad all borders with this value.
|
|
1443
1442
|
If a tuple or lists of 2 values are provided, pad the (left and top)
|
|
1444
1443
|
with the first value and (right and bottom) with the second value.
|
|
1445
1444
|
If 4 values are provided as a list or tuple, pad the left, top, right and bottom respectively.
|
|
1446
1445
|
pad_if_needed (bool, optional): Pad the image if either side is smaller than
|
|
1447
|
-
the given output size
|
|
1446
|
+
the given output size. Default: False.
|
|
1448
1447
|
fill_value (Union[int, tuple[int]], optional): The pixel intensity of the borders, only valid for
|
|
1449
1448
|
padding_mode Border.CONSTANT. If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
1450
1449
|
If it is an integer, it is used for all RGB channels.
|
|
1451
|
-
The fill_value values must be in range [0, 255]
|
|
1452
|
-
padding_mode (Border, optional): The method of padding
|
|
1450
|
+
The fill_value values must be in range [0, 255]. Default: 0.
|
|
1451
|
+
padding_mode (Border, optional): The method of padding. Default: Border.CONSTANT. It can be any of
|
|
1453
1452
|
[Border.CONSTANT, Border.EDGE, Border.REFLECT, Border.SYMMETRIC].
|
|
1454
1453
|
|
|
1455
1454
|
- Border.CONSTANT, means it fills the border with constant values.
|
|
@@ -1473,7 +1472,7 @@ class RandomCropWithBBox(ImageTensorOperation):
|
|
|
1473
1472
|
TypeError: If `padding` is not of type int or Sequence[int].
|
|
1474
1473
|
TypeError: If `pad_if_needed` is not of type boolean.
|
|
1475
1474
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
1476
|
-
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border
|
|
1475
|
+
TypeError: If `padding_mode` is not of type :class:`mindspore.dataset.vision.Border` .
|
|
1477
1476
|
ValueError: If `size` is not positive.
|
|
1478
1477
|
ValueError: If `padding` is negative.
|
|
1479
1478
|
ValueError: If `fill_value` is not in range [0, 255].
|
|
@@ -1521,7 +1520,7 @@ class RandomEqualize(ImageTensorOperation):
|
|
|
1521
1520
|
|
|
1522
1521
|
Args:
|
|
1523
1522
|
prob (float, optional): Probability of the image being equalized, which
|
|
1524
|
-
must be in range of [0, 1]
|
|
1523
|
+
must be in range of [0, 1]. Default: 0.5.
|
|
1525
1524
|
|
|
1526
1525
|
Raises:
|
|
1527
1526
|
TypeError: If `prob` is not of type float.
|
|
@@ -1554,7 +1553,7 @@ class RandomHorizontalFlip(ImageTensorOperation):
|
|
|
1554
1553
|
This operation supports running on Ascend or GPU platforms by Offload.
|
|
1555
1554
|
|
|
1556
1555
|
Args:
|
|
1557
|
-
prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]
|
|
1556
|
+
prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]. Default: 0.5.
|
|
1558
1557
|
|
|
1559
1558
|
Raises:
|
|
1560
1559
|
TypeError: If `prob` is not of type float.
|
|
@@ -1562,7 +1561,7 @@ class RandomHorizontalFlip(ImageTensorOperation):
|
|
|
1562
1561
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
1563
1562
|
|
|
1564
1563
|
Supported Platforms:
|
|
1565
|
-
``
|
|
1564
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
1566
1565
|
|
|
1567
1566
|
Examples:
|
|
1568
1567
|
>>> transforms_list = [c_vision.Decode(), c_vision.RandomHorizontalFlip(0.75)]
|
|
@@ -1584,7 +1583,7 @@ class RandomHorizontalFlipWithBBox(ImageTensorOperation):
|
|
|
1584
1583
|
Flip the input image horizontally randomly with a given probability and adjust bounding boxes accordingly.
|
|
1585
1584
|
|
|
1586
1585
|
Args:
|
|
1587
|
-
prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]
|
|
1586
|
+
prob (float, optional): Probability of the image being flipped, which must be in range of [0, 1]. Default: 0.5.
|
|
1588
1587
|
|
|
1589
1588
|
Raises:
|
|
1590
1589
|
TypeError: If `prob` is not of type float.
|
|
@@ -1614,7 +1613,7 @@ class RandomInvert(ImageTensorOperation):
|
|
|
1614
1613
|
Randomly invert the colors of image with a given probability.
|
|
1615
1614
|
|
|
1616
1615
|
Args:
|
|
1617
|
-
prob (float, optional): Probability of the image being inverted, which must be in range of [0, 1]
|
|
1616
|
+
prob (float, optional): Probability of the image being inverted, which must be in range of [0, 1]. Default: 0.5.
|
|
1618
1617
|
|
|
1619
1618
|
Raises:
|
|
1620
1619
|
TypeError: If `prob` is not of type float.
|
|
@@ -1645,7 +1644,7 @@ class RandomLighting(ImageTensorOperation):
|
|
|
1645
1644
|
calculated from the imagenet dataset.
|
|
1646
1645
|
|
|
1647
1646
|
Args:
|
|
1648
|
-
alpha (float, optional): Intensity of the image, which must be non-negative
|
|
1647
|
+
alpha (float, optional): Intensity of the image, which must be non-negative. Default: 0.05.
|
|
1649
1648
|
|
|
1650
1649
|
Raises:
|
|
1651
1650
|
TypeError: If `alpha` is not of type float.
|
|
@@ -1679,7 +1678,7 @@ class RandomPosterize(ImageTensorOperation):
|
|
|
1679
1678
|
Bits values must be in range of [1,8], and include at
|
|
1680
1679
|
least one integer value in the given range. It must be in
|
|
1681
1680
|
(min, max) or integer format. If min=max, then it is a single fixed
|
|
1682
|
-
magnitude operation (
|
|
1681
|
+
magnitude operation. Default: (8, 8).
|
|
1683
1682
|
|
|
1684
1683
|
Raises:
|
|
1685
1684
|
TypeError: If `bits` is not of type int or sequence of int.
|
|
@@ -1709,7 +1708,7 @@ class RandomPosterize(ImageTensorOperation):
|
|
|
1709
1708
|
|
|
1710
1709
|
class RandomResizedCrop(ImageTensorOperation):
|
|
1711
1710
|
"""
|
|
1712
|
-
This
|
|
1711
|
+
This operation will crop the input image randomly, and resize the cropped image using a selected interpolation mode.
|
|
1713
1712
|
|
|
1714
1713
|
Note:
|
|
1715
1714
|
If the input image is more than one, then make sure that the image size is the same.
|
|
@@ -1719,10 +1718,10 @@ class RandomResizedCrop(ImageTensorOperation):
|
|
|
1719
1718
|
If size is an integer, a square of size (size, size) will be cropped with this value.
|
|
1720
1719
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
1721
1720
|
scale (Union[list, tuple], optional): Range [min, max) of respective size of the original
|
|
1722
|
-
size to be cropped, which must be non-negative (
|
|
1721
|
+
size to be cropped, which must be non-negative. Default: (0.08, 1.0).
|
|
1723
1722
|
ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
|
|
1724
|
-
cropped, which must be non-negative (
|
|
1725
|
-
interpolation (Inter, optional): Method of interpolation
|
|
1723
|
+
cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
|
|
1724
|
+
interpolation (Inter, optional): Method of interpolation. Default: Inter.BILINEAR.
|
|
1726
1725
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
|
|
1727
1726
|
|
|
1728
1727
|
- Inter.BILINEAR, means interpolation method is bilinear interpolation.
|
|
@@ -1737,19 +1736,19 @@ class RandomResizedCrop(ImageTensorOperation):
|
|
|
1737
1736
|
should be in 3 channels format.
|
|
1738
1737
|
|
|
1739
1738
|
max_attempts (int, optional): The maximum number of attempts to propose a valid
|
|
1740
|
-
crop_area
|
|
1739
|
+
crop_area. Default: 10. If exceeded, fall back to use center_crop instead.
|
|
1741
1740
|
|
|
1742
1741
|
Raises:
|
|
1743
1742
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
1744
1743
|
TypeError: If `scale` is not of type tuple or list.
|
|
1745
1744
|
TypeError: If `ratio` is not of type tuple or list.
|
|
1746
|
-
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter
|
|
1745
|
+
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
1747
1746
|
TypeError: If `max_attempts` is not of type int.
|
|
1748
1747
|
ValueError: If `size` is not positive.
|
|
1749
1748
|
ValueError: If `scale` is negative.
|
|
1750
1749
|
ValueError: If `ratio` is negative.
|
|
1751
1750
|
ValueError: If `max_attempts` is not positive.
|
|
1752
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
1751
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
1753
1752
|
|
|
1754
1753
|
Supported Platforms:
|
|
1755
1754
|
``CPU``
|
|
@@ -1790,10 +1789,10 @@ class RandomResizedCropWithBBox(ImageTensorOperation):
|
|
|
1790
1789
|
If size is an integer, a square of size (size, size) will be cropped with this value.
|
|
1791
1790
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
1792
1791
|
scale (Union[list, tuple], optional): Range (min, max) of respective size of the original
|
|
1793
|
-
size to be cropped, which must be non-negative (
|
|
1792
|
+
size to be cropped, which must be non-negative. Default: (0.08, 1.0).
|
|
1794
1793
|
ratio (Union[list, tuple], optional): Range (min, max) of aspect ratio to be
|
|
1795
|
-
cropped, which must be non-negative (
|
|
1796
|
-
interpolation (Inter mode, optional): Method of interpolation
|
|
1794
|
+
cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
|
|
1795
|
+
interpolation (Inter mode, optional): Method of interpolation. Default: Inter.BILINEAR.
|
|
1797
1796
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC] .
|
|
1798
1797
|
|
|
1799
1798
|
- Inter.BILINEAR, means interpolation method is bilinear interpolation.
|
|
@@ -1803,13 +1802,13 @@ class RandomResizedCropWithBBox(ImageTensorOperation):
|
|
|
1803
1802
|
- Inter.BICUBIC, means interpolation method is bicubic interpolation.
|
|
1804
1803
|
|
|
1805
1804
|
max_attempts (int, optional): The maximum number of attempts to propose a valid
|
|
1806
|
-
crop area
|
|
1805
|
+
crop area. Default: 10. If exceeded, fall back to use center crop instead.
|
|
1807
1806
|
|
|
1808
1807
|
Raises:
|
|
1809
1808
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
1810
1809
|
TypeError: If `scale` is not of type tuple or list.
|
|
1811
1810
|
TypeError: If `ratio` is not of type tuple or list.
|
|
1812
|
-
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter
|
|
1811
|
+
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
1813
1812
|
TypeError: If `max_attempts` is not of type int.
|
|
1814
1813
|
ValueError: If `size` is not positive.
|
|
1815
1814
|
ValueError: If `scale` is negative.
|
|
@@ -1935,7 +1934,7 @@ class RandomRotation(ImageTensorOperation):
|
|
|
1935
1934
|
degrees (Union[int, float, sequence]): Range of random rotation degrees.
|
|
1936
1935
|
If `degrees` is a number, the range will be converted to (-degrees, degrees).
|
|
1937
1936
|
If `degrees` is a sequence, it should be (min, max).
|
|
1938
|
-
resample (Inter, optional): An optional resampling filter
|
|
1937
|
+
resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
|
|
1939
1938
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA].
|
|
1940
1939
|
|
|
1941
1940
|
- Inter.BILINEAR, means resample method is bilinear interpolation.
|
|
@@ -1944,22 +1943,22 @@ class RandomRotation(ImageTensorOperation):
|
|
|
1944
1943
|
|
|
1945
1944
|
- Inter.BICUBIC, means resample method is bicubic interpolation.
|
|
1946
1945
|
|
|
1947
|
-
- Inter.AREA: means the interpolation method is area interpolation.
|
|
1946
|
+
- Inter.AREA: means the interpolation method is pixel area interpolation.
|
|
1948
1947
|
|
|
1949
|
-
expand (bool, optional): Optional expansion flag
|
|
1948
|
+
expand (bool, optional): Optional expansion flag. Default: False. If set to True, expand the output
|
|
1950
1949
|
image to make it large enough to hold the entire rotated image.
|
|
1951
1950
|
If set to False or omitted, make the output image the same size as the input.
|
|
1952
1951
|
Note that the expand flag assumes rotation around the center and no translation.
|
|
1953
|
-
center (tuple, optional): Optional center of rotation (a 2-tuple)
|
|
1952
|
+
center (tuple, optional): Optional center of rotation (a 2-tuple). Default: None.
|
|
1954
1953
|
Origin is the top left corner. None sets to the center of the image.
|
|
1955
1954
|
fill_value (Union[int, tuple[int]], optional): Optional fill color for the area outside the rotated image.
|
|
1956
1955
|
If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
1957
1956
|
If it is an integer, it is used for all RGB channels.
|
|
1958
|
-
The fill_value values must be in range [0, 255]
|
|
1957
|
+
The fill_value values must be in range [0, 255]. Default: 0.
|
|
1959
1958
|
|
|
1960
1959
|
Raises:
|
|
1961
1960
|
TypeError: If `degrees` is not of type int, float or sequence.
|
|
1962
|
-
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter
|
|
1961
|
+
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
1963
1962
|
TypeError: If `expand` is not of type boolean.
|
|
1964
1963
|
TypeError: If `center` is not of type tuple.
|
|
1965
1964
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
@@ -2063,7 +2062,7 @@ class RandomSharpness(ImageTensorOperation):
|
|
|
2063
2062
|
Args:
|
|
2064
2063
|
degrees (Union[list, tuple], optional): Range of random sharpness adjustment degrees,
|
|
2065
2064
|
which must be non-negative. It should be in (min, max) format. If min=max, then
|
|
2066
|
-
it is a single fixed magnitude operation
|
|
2065
|
+
it is a single fixed magnitude operation. Default: (0.1, 1.9).
|
|
2067
2066
|
|
|
2068
2067
|
Raises:
|
|
2069
2068
|
TypeError : If `degrees` is not of type list or tuple.
|
|
@@ -2071,7 +2070,7 @@ class RandomSharpness(ImageTensorOperation):
|
|
|
2071
2070
|
ValueError: If `degrees` is in (max, min) format instead of (min, max).
|
|
2072
2071
|
|
|
2073
2072
|
Supported Platforms:
|
|
2074
|
-
``
|
|
2073
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
2075
2074
|
|
|
2076
2075
|
Examples:
|
|
2077
2076
|
>>> transforms_list = [c_vision.Decode(), c_vision.RandomSharpness(degrees=(0.2, 1.9))]
|
|
@@ -2094,7 +2093,7 @@ class RandomSolarize(ImageTensorOperation):
|
|
|
2094
2093
|
the subrange to (255 - pixel).
|
|
2095
2094
|
|
|
2096
2095
|
Args:
|
|
2097
|
-
threshold (tuple, optional): Range of random solarize threshold (
|
|
2096
|
+
threshold (tuple, optional): Range of random solarize threshold. Default: (0, 255).
|
|
2098
2097
|
Threshold values should always be in (min, max) format,
|
|
2099
2098
|
where min and max are integers in the range [0, 255], and min <= max.
|
|
2100
2099
|
If min=max, then invert all pixel values above min(max).
|
|
@@ -2129,7 +2128,7 @@ class RandomVerticalFlip(ImageTensorOperation):
|
|
|
2129
2128
|
This operation supports running on Ascend or GPU platforms by Offload.
|
|
2130
2129
|
|
|
2131
2130
|
Args:
|
|
2132
|
-
prob (float, optional): Probability of the image being flipped
|
|
2131
|
+
prob (float, optional): Probability of the image being flipped. Default: 0.5.
|
|
2133
2132
|
|
|
2134
2133
|
Raises:
|
|
2135
2134
|
TypeError: If `prob` is not of type float.
|
|
@@ -2137,7 +2136,7 @@ class RandomVerticalFlip(ImageTensorOperation):
|
|
|
2137
2136
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
2138
2137
|
|
|
2139
2138
|
Supported Platforms:
|
|
2140
|
-
``
|
|
2139
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
2141
2140
|
|
|
2142
2141
|
Examples:
|
|
2143
2142
|
>>> transforms_list = [c_vision.Decode(), c_vision.RandomVerticalFlip(0.25)]
|
|
@@ -2159,7 +2158,7 @@ class RandomVerticalFlipWithBBox(ImageTensorOperation):
|
|
|
2159
2158
|
Flip the input image vertically, randomly with a given probability and adjust bounding boxes accordingly.
|
|
2160
2159
|
|
|
2161
2160
|
Args:
|
|
2162
|
-
prob (float, optional): Probability of the image being flipped
|
|
2161
|
+
prob (float, optional): Probability of the image being flipped. Default: 0.5.
|
|
2163
2162
|
|
|
2164
2163
|
Raises:
|
|
2165
2164
|
TypeError: If `prob` is not of type float.
|
|
@@ -2186,7 +2185,7 @@ class RandomVerticalFlipWithBBox(ImageTensorOperation):
|
|
|
2186
2185
|
|
|
2187
2186
|
class Rescale(ImageTensorOperation):
|
|
2188
2187
|
"""
|
|
2189
|
-
Rescale the input image with the given rescale and shift. This
|
|
2188
|
+
Rescale the input image with the given rescale and shift. This operation will rescale the input image
|
|
2190
2189
|
with: output = image * rescale + shift.
|
|
2191
2190
|
|
|
2192
2191
|
Note:
|
|
@@ -2201,7 +2200,7 @@ class Rescale(ImageTensorOperation):
|
|
|
2201
2200
|
TypeError: If `shift` is not of type float.
|
|
2202
2201
|
|
|
2203
2202
|
Supported Platforms:
|
|
2204
|
-
``
|
|
2203
|
+
``Ascend`` ``GPU`` ``CPU``
|
|
2205
2204
|
|
|
2206
2205
|
Examples:
|
|
2207
2206
|
>>> transforms_list = [c_vision.Decode(), c_vision.Rescale(1.0 / 255.0, -1.0)]
|
|
@@ -2228,7 +2227,7 @@ class Resize(ImageTensorOperation):
|
|
|
2228
2227
|
If size is an integer, the smaller edge of the image will be resized to this value with
|
|
2229
2228
|
the same image aspect ratio.
|
|
2230
2229
|
If size is a sequence of length 2, it should be (height, width).
|
|
2231
|
-
interpolation (Inter, optional): Image interpolation mode
|
|
2230
|
+
interpolation (Inter, optional): Image interpolation mode. Default: Inter.LINEAR.
|
|
2232
2231
|
It can be any of [Inter.LINEAR, Inter.NEAREST, Inter.BICUBIC, Inter.AREA, Inter.PILCUBIC].
|
|
2233
2232
|
|
|
2234
2233
|
- Inter.LINEAR, means interpolation method is bilinear interpolation.
|
|
@@ -2244,7 +2243,7 @@ class Resize(ImageTensorOperation):
|
|
|
2244
2243
|
|
|
2245
2244
|
Raises:
|
|
2246
2245
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
2247
|
-
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter
|
|
2246
|
+
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
2248
2247
|
ValueError: If `size` is not positive.
|
|
2249
2248
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
2250
2249
|
|
|
@@ -2281,7 +2280,7 @@ class ResizeWithBBox(ImageTensorOperation):
|
|
|
2281
2280
|
If size is an integer, smaller edge of the image will be resized to this value with
|
|
2282
2281
|
the same image aspect ratio.
|
|
2283
2282
|
If size is a sequence of length 2, it should be (height, width).
|
|
2284
|
-
interpolation (Inter, optional): Image interpolation mode
|
|
2283
|
+
interpolation (Inter, optional): Image interpolation mode. Default: Inter.LINEAR.
|
|
2285
2284
|
It can be any of [Inter.LINEAR, Inter.NEAREST, Inter.BICUBIC].
|
|
2286
2285
|
|
|
2287
2286
|
- Inter.LINEAR, means interpolation method is bilinear interpolation.
|
|
@@ -2292,7 +2291,7 @@ class ResizeWithBBox(ImageTensorOperation):
|
|
|
2292
2291
|
|
|
2293
2292
|
Raises:
|
|
2294
2293
|
TypeError: If `size` is not of type int or Sequence[int].
|
|
2295
|
-
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter
|
|
2294
|
+
TypeError: If `interpolation` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
2296
2295
|
ValueError: If `size` is not positive.
|
|
2297
2296
|
RuntimeError: If given tensor shape is not <H, W> or <H, W, C>.
|
|
2298
2297
|
|
|
@@ -2356,32 +2355,32 @@ class Rotate(ImageTensorOperation):
|
|
|
2356
2355
|
Args:
|
|
2357
2356
|
degrees (Union[int, float]): Rotation degrees.
|
|
2358
2357
|
|
|
2359
|
-
resample (Inter, optional): An optional resampling filter
|
|
2358
|
+
resample (Inter, optional): An optional resampling filter. Default: Inter.NEAREST.
|
|
2360
2359
|
It can be any of [Inter.BILINEAR, Inter.NEAREST, Inter.BICUBIC].
|
|
2361
2360
|
|
|
2362
2361
|
- Inter.BILINEAR, means resample method is bilinear interpolation.
|
|
2363
2362
|
- Inter.NEAREST, means resample method is nearest-neighbor interpolation.
|
|
2364
2363
|
- Inter.BICUBIC, means resample method is bicubic interpolation.
|
|
2365
2364
|
|
|
2366
|
-
expand (bool, optional): Optional expansion flag
|
|
2365
|
+
expand (bool, optional): Optional expansion flag. Default: False. If set to True, expand the output
|
|
2367
2366
|
image to make it large enough to hold the entire rotated image.
|
|
2368
2367
|
If set to False or omitted, make the output image the same size as the input.
|
|
2369
2368
|
Note that the expand flag assumes rotation around the center and no translation.
|
|
2370
|
-
center (tuple, optional): Optional center of rotation (a 2-tuple)
|
|
2369
|
+
center (tuple, optional): Optional center of rotation (a 2-tuple). Default: None.
|
|
2371
2370
|
Origin is the top left corner. None sets to the center of the image.
|
|
2372
2371
|
fill_value (Union[int, tuple[int]], optional): Optional fill color for the area outside the rotated image.
|
|
2373
2372
|
If it is a 3-tuple, it is used to fill R, G, B channels respectively.
|
|
2374
2373
|
If it is an integer, it is used for all RGB channels.
|
|
2375
|
-
The fill_value values must be in range [0, 255]
|
|
2374
|
+
The fill_value values must be in range [0, 255]. Default: 0.
|
|
2376
2375
|
|
|
2377
2376
|
Raises:
|
|
2378
2377
|
TypeError: If `degrees` is not of type int or float.
|
|
2379
|
-
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter
|
|
2378
|
+
TypeError: If `resample` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
2380
2379
|
TypeError: If `expand` is not of type bool.
|
|
2381
2380
|
TypeError: If `center` is not of type tuple.
|
|
2382
2381
|
TypeError: If `fill_value` is not of type int or tuple[int].
|
|
2383
2382
|
ValueError: If `fill_value` is not in range [0, 255].
|
|
2384
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
2383
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
2385
2384
|
|
|
2386
2385
|
Supported Platforms:
|
|
2387
2386
|
``CPU``
|
|
@@ -2425,18 +2424,18 @@ class SlicePatches(ImageTensorOperation):
|
|
|
2425
2424
|
number of output tensors is equal to num_height*num_width.
|
|
2426
2425
|
|
|
2427
2426
|
Args:
|
|
2428
|
-
num_height (int, optional): The number of patches in vertical direction, which must be positive
|
|
2429
|
-
num_width (int, optional): The number of patches in horizontal direction, which must be positive
|
|
2430
|
-
slice_mode (Inter, optional): A mode represents pad or drop
|
|
2427
|
+
num_height (int, optional): The number of patches in vertical direction, which must be positive. Default: 1.
|
|
2428
|
+
num_width (int, optional): The number of patches in horizontal direction, which must be positive. Default: 1.
|
|
2429
|
+
slice_mode (Inter, optional): A mode represents pad or drop. Default: SliceMode.PAD.
|
|
2431
2430
|
It can be any of [SliceMode.PAD, SliceMode.DROP].
|
|
2432
2431
|
fill_value (int, optional): The border width in number of pixels in
|
|
2433
2432
|
right and bottom direction if slice_mode is set to be SliceMode.PAD.
|
|
2434
|
-
The fill_value must be in range [0, 255]
|
|
2433
|
+
The fill_value must be in range [0, 255]. Default: 0.
|
|
2435
2434
|
|
|
2436
2435
|
Raises:
|
|
2437
2436
|
TypeError: If `num_height` is not of type int.
|
|
2438
2437
|
TypeError: If `num_width` is not of type int.
|
|
2439
|
-
TypeError: If `slice_mode` is not of type :class:`mindspore.dataset.vision.Inter
|
|
2438
|
+
TypeError: If `slice_mode` is not of type :class:`mindspore.dataset.vision.Inter` .
|
|
2440
2439
|
TypeError: If `fill_value` is not of type int.
|
|
2441
2440
|
ValueError: If `num_height` is not positive.
|
|
2442
2441
|
ValueError: If `num_width` is not positive.
|
|
@@ -2455,7 +2454,7 @@ class SlicePatches(ImageTensorOperation):
|
|
|
2455
2454
|
>>> cols = ['img' + str(x) for x in range(num_h*num_w)]
|
|
2456
2455
|
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
|
|
2457
2456
|
... input_columns=["image"],
|
|
2458
|
-
... output_columns=cols
|
|
2457
|
+
... output_columns=cols)
|
|
2459
2458
|
"""
|
|
2460
2459
|
|
|
2461
2460
|
@deprecated_c_vision()
|
|
@@ -2473,7 +2472,7 @@ class SlicePatches(ImageTensorOperation):
|
|
|
2473
2472
|
|
|
2474
2473
|
class SoftDvppDecodeRandomCropResizeJpeg(ImageTensorOperation):
|
|
2475
2474
|
"""
|
|
2476
|
-
A combination of `Crop
|
|
2475
|
+
A combination of `Crop` , `Decode` and `Resize` using the simulation algorithm of Ascend series chip DVPP module.
|
|
2477
2476
|
|
|
2478
2477
|
The usage scenario is consistent with SoftDvppDecodeResizeJpeg.
|
|
2479
2478
|
The input image size should be in range [32*32, 8192*8192].
|
|
@@ -2489,10 +2488,10 @@ class SoftDvppDecodeRandomCropResizeJpeg(ImageTensorOperation):
|
|
|
2489
2488
|
If size is an integer, a square crop of size (size, size) is returned.
|
|
2490
2489
|
If size is a sequence of length 2, an image of size (height, width) will be cropped.
|
|
2491
2490
|
scale (Union[list, tuple], optional): Range [min, max) of respective size of the
|
|
2492
|
-
original size to be cropped, which must be non-negative (
|
|
2491
|
+
original size to be cropped, which must be non-negative. Default: (0.08, 1.0).
|
|
2493
2492
|
ratio (Union[list, tuple], optional): Range [min, max) of aspect ratio to be
|
|
2494
|
-
cropped, which must be non-negative (
|
|
2495
|
-
max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area
|
|
2493
|
+
cropped, which must be non-negative. Default: (3. / 4., 4. / 3.).
|
|
2494
|
+
max_attempts (int, optional): The maximum number of attempts to propose a valid crop_area. Default: 10.
|
|
2496
2495
|
If exceeded, fall back to use center_crop instead. The max_attempts value must be positive.
|
|
2497
2496
|
|
|
2498
2497
|
Raises:
|
|
@@ -2565,11 +2564,11 @@ class UniformAugment(ImageTensorOperation):
|
|
|
2565
2564
|
Args:
|
|
2566
2565
|
transforms (TensorOperation): C++ transformation operation to be applied on random selection
|
|
2567
2566
|
of bounding box regions of a given image (Python operations are not accepted).
|
|
2568
|
-
num_ops (int, optional): Number of operations to be selected and applied, which must be positive
|
|
2567
|
+
num_ops (int, optional): Number of operations to be selected and applied, which must be positive. Default: 2.
|
|
2569
2568
|
|
|
2570
2569
|
Raises:
|
|
2571
2570
|
TypeError: If `transform` is not an image processing operation
|
|
2572
|
-
in :class:`mindspore.dataset.vision.c_transforms
|
|
2571
|
+
in :class:`mindspore.dataset.vision.c_transforms` .
|
|
2573
2572
|
TypeError: If `num_ops` is not of type int.
|
|
2574
2573
|
ValueError: If `num_ops` is not positive.
|
|
2575
2574
|
|
|
@@ -2611,7 +2610,7 @@ class VerticalFlip(ImageTensorOperation):
|
|
|
2611
2610
|
Flip the input image vertically.
|
|
2612
2611
|
|
|
2613
2612
|
Raises:
|
|
2614
|
-
RuntimeError: If given tensor shape is not <H, W> or
|
|
2613
|
+
RuntimeError: If given tensor shape is not <H, W> or <..., H, W, C>.
|
|
2615
2614
|
|
|
2616
2615
|
Supported Platforms:
|
|
2617
2616
|
``CPU``
|