mindspore 2.3.0__cp310-cp310-win_amd64.whl → 2.4.1__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/__init__.py +3 -1
- mindspore/_c_dataengine.cp310-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp310-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp310-win_amd64.pyd +0 -0
- mindspore/_checkparam.py +50 -9
- mindspore/_extends/parse/compile_config.py +41 -0
- mindspore/_extends/parse/parser.py +9 -7
- mindspore/_extends/parse/standard_method.py +52 -14
- mindspore/_extends/pijit/pijit_func_white_list.py +350 -24
- mindspore/amp.py +24 -10
- mindspore/common/__init__.py +6 -4
- mindspore/common/_pijit_context.py +190 -0
- mindspore/common/_register_for_tensor.py +2 -1
- mindspore/common/_tensor_overload.py +139 -0
- mindspore/common/api.py +102 -87
- mindspore/common/dump.py +5 -6
- mindspore/common/generator.py +1 -7
- mindspore/common/hook_handle.py +14 -26
- mindspore/common/initializer.py +51 -15
- mindspore/common/mindir_util.py +2 -2
- mindspore/common/parameter.py +62 -15
- mindspore/common/recompute.py +39 -9
- mindspore/common/sparse_tensor.py +7 -3
- mindspore/common/tensor.py +183 -37
- mindspore/communication/__init__.py +1 -1
- mindspore/communication/_comm_helper.py +38 -3
- mindspore/communication/comm_func.py +315 -60
- mindspore/communication/management.py +14 -14
- mindspore/context.py +132 -22
- mindspore/dataset/__init__.py +1 -1
- mindspore/dataset/audio/__init__.py +1 -1
- mindspore/dataset/core/config.py +7 -0
- mindspore/dataset/core/validator_helpers.py +7 -0
- mindspore/dataset/engine/cache_client.py +1 -1
- mindspore/dataset/engine/datasets.py +72 -44
- mindspore/dataset/engine/datasets_audio.py +7 -7
- mindspore/dataset/engine/datasets_standard_format.py +53 -3
- mindspore/dataset/engine/datasets_text.py +20 -20
- mindspore/dataset/engine/datasets_user_defined.py +174 -104
- mindspore/dataset/engine/datasets_vision.py +33 -33
- mindspore/dataset/engine/iterators.py +29 -0
- mindspore/dataset/engine/obs/util.py +7 -0
- mindspore/dataset/engine/queue.py +114 -60
- mindspore/dataset/engine/serializer_deserializer.py +2 -2
- mindspore/dataset/engine/validators.py +34 -14
- mindspore/dataset/text/__init__.py +1 -4
- mindspore/dataset/transforms/__init__.py +0 -3
- mindspore/dataset/utils/line_reader.py +2 -0
- mindspore/dataset/vision/__init__.py +1 -4
- mindspore/dataset/vision/utils.py +1 -1
- mindspore/dataset/vision/validators.py +2 -1
- mindspore/{nn/extend → experimental/es}/__init__.py +4 -11
- mindspore/experimental/es/embedding_service.py +883 -0
- mindspore/{nn/layer → experimental/es}/embedding_service_layer.py +218 -30
- mindspore/experimental/llm_boost/__init__.py +21 -0
- mindspore/{nn/extend/layer → experimental/llm_boost/atb}/__init__.py +4 -8
- mindspore/experimental/llm_boost/atb/boost_base.py +211 -0
- mindspore/experimental/llm_boost/atb/llama_boost.py +115 -0
- mindspore/experimental/llm_boost/atb/qwen_boost.py +101 -0
- mindspore/experimental/llm_boost/register.py +129 -0
- mindspore/experimental/llm_boost/utils.py +31 -0
- mindspore/experimental/optim/adamw.py +85 -0
- mindspore/experimental/optim/optimizer.py +3 -0
- mindspore/hal/__init__.py +3 -3
- mindspore/hal/contiguous_tensors_handle.py +175 -0
- mindspore/hal/stream.py +18 -0
- mindspore/include/api/model_group.h +13 -1
- mindspore/include/api/types.h +10 -10
- mindspore/include/dataset/config.h +2 -2
- mindspore/include/dataset/constants.h +2 -2
- mindspore/include/dataset/execute.h +2 -2
- mindspore/include/dataset/vision.h +4 -0
- mindspore/log.py +1 -1
- mindspore/mindrecord/filewriter.py +68 -51
- mindspore/mindspore_backend.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_np_dtype.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/mint/__init__.py +983 -46
- mindspore/mint/distributed/__init__.py +31 -0
- mindspore/mint/distributed/distributed.py +254 -0
- mindspore/mint/nn/__init__.py +268 -23
- mindspore/mint/nn/functional.py +125 -19
- mindspore/mint/nn/layer/__init__.py +39 -0
- mindspore/mint/nn/layer/activation.py +133 -0
- mindspore/mint/nn/layer/normalization.py +477 -0
- mindspore/mint/nn/layer/pooling.py +110 -0
- mindspore/mint/optim/adamw.py +26 -13
- mindspore/mint/special/__init__.py +63 -0
- mindspore/multiprocessing/__init__.py +2 -1
- mindspore/nn/__init__.py +0 -1
- mindspore/nn/cell.py +276 -96
- mindspore/nn/layer/activation.py +211 -44
- mindspore/nn/layer/basic.py +137 -10
- mindspore/nn/layer/embedding.py +137 -2
- mindspore/nn/layer/normalization.py +101 -5
- mindspore/nn/layer/padding.py +34 -48
- mindspore/nn/layer/pooling.py +161 -7
- mindspore/nn/layer/transformer.py +3 -3
- mindspore/nn/loss/__init__.py +2 -2
- mindspore/nn/loss/loss.py +84 -6
- mindspore/nn/optim/__init__.py +2 -1
- mindspore/nn/optim/adadelta.py +1 -1
- mindspore/nn/optim/adam.py +1 -1
- mindspore/nn/optim/lamb.py +1 -1
- mindspore/nn/optim/tft_wrapper.py +124 -0
- mindspore/nn/wrap/cell_wrapper.py +12 -23
- mindspore/nn/wrap/grad_reducer.py +5 -5
- mindspore/nn/wrap/loss_scale.py +17 -3
- mindspore/numpy/__init__.py +1 -1
- mindspore/numpy/array_creations.py +65 -68
- mindspore/numpy/array_ops.py +64 -60
- mindspore/numpy/fft.py +610 -75
- mindspore/numpy/logic_ops.py +11 -10
- mindspore/numpy/math_ops.py +85 -84
- mindspore/numpy/utils_const.py +4 -4
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/__init__.py +6 -4
- mindspore/ops/_grad_experimental/grad_array_ops.py +0 -11
- mindspore/ops/_grad_experimental/grad_comm_ops.py +67 -4
- mindspore/ops/_grad_experimental/grad_math_ops.py +0 -22
- mindspore/ops/_vmap/vmap_array_ops.py +2 -4
- mindspore/ops/_vmap/vmap_math_ops.py +17 -1
- mindspore/ops/_vmap/vmap_nn_ops.py +43 -2
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +91 -7
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +2 -0
- mindspore/ops/auto_generate/gen_extend_func.py +767 -13
- mindspore/ops/auto_generate/gen_ops_def.py +2452 -364
- mindspore/ops/auto_generate/gen_ops_prim.py +5442 -1756
- mindspore/ops/auto_generate/pyboost_inner_prim.py +176 -56
- mindspore/ops/composite/base.py +85 -48
- mindspore/ops/composite/multitype_ops/_compile_utils.py +1 -0
- mindspore/ops/composite/multitype_ops/not_in_impl.py +2 -2
- mindspore/ops/function/__init__.py +22 -0
- mindspore/ops/function/array_func.py +492 -153
- mindspore/ops/function/debug_func.py +113 -1
- mindspore/ops/function/fft_func.py +15 -2
- mindspore/ops/function/grad/grad_func.py +3 -2
- mindspore/ops/function/math_func.py +564 -207
- mindspore/ops/function/nn_func.py +817 -383
- mindspore/ops/function/other_func.py +3 -2
- mindspore/ops/function/random_func.py +402 -12
- mindspore/ops/function/reshard_func.py +13 -11
- mindspore/ops/function/sparse_unary_func.py +1 -1
- mindspore/ops/function/vmap_func.py +3 -2
- mindspore/ops/functional.py +24 -14
- mindspore/ops/op_info_register.py +3 -3
- mindspore/ops/operations/__init__.py +7 -2
- mindspore/ops/operations/_grad_ops.py +2 -76
- mindspore/ops/operations/_infer_ops.py +1 -1
- mindspore/ops/operations/_inner_ops.py +71 -94
- mindspore/ops/operations/array_ops.py +14 -146
- mindspore/ops/operations/comm_ops.py +63 -53
- mindspore/ops/operations/custom_ops.py +83 -19
- mindspore/ops/operations/debug_ops.py +42 -10
- mindspore/ops/operations/manually_defined/_inner.py +12 -0
- mindspore/ops/operations/manually_defined/ops_def.py +273 -20
- mindspore/ops/operations/math_ops.py +12 -223
- mindspore/ops/operations/nn_ops.py +20 -114
- mindspore/ops/operations/other_ops.py +7 -4
- mindspore/ops/operations/random_ops.py +46 -1
- mindspore/ops/primitive.py +18 -6
- mindspore/ops_generate/arg_dtype_cast.py +2 -0
- mindspore/ops_generate/gen_aclnn_implement.py +11 -11
- mindspore/ops_generate/gen_constants.py +36 -0
- mindspore/ops_generate/gen_ops.py +67 -52
- mindspore/ops_generate/gen_ops_inner_prim.py +1 -1
- mindspore/ops_generate/gen_pyboost_func.py +131 -47
- mindspore/ops_generate/op_proto.py +10 -3
- mindspore/ops_generate/pyboost_utils.py +14 -1
- mindspore/ops_generate/template.py +43 -21
- mindspore/parallel/__init__.py +3 -1
- mindspore/parallel/_auto_parallel_context.py +31 -9
- mindspore/parallel/_cell_wrapper.py +85 -0
- mindspore/parallel/_parallel_serialization.py +47 -19
- mindspore/parallel/_tensor.py +127 -13
- mindspore/parallel/_utils.py +53 -22
- mindspore/parallel/algo_parameter_config.py +5 -5
- mindspore/parallel/checkpoint_transform.py +46 -39
- mindspore/parallel/cluster/process_entity/__init__.py +1 -1
- mindspore/parallel/cluster/process_entity/_api.py +31 -23
- mindspore/parallel/cluster/process_entity/_utils.py +2 -27
- mindspore/parallel/parameter_broadcast.py +3 -4
- mindspore/parallel/shard.py +162 -31
- mindspore/parallel/transform_safetensors.py +1146 -0
- mindspore/profiler/__init__.py +2 -1
- mindspore/profiler/common/constant.py +29 -0
- mindspore/profiler/common/registry.py +47 -0
- mindspore/profiler/common/util.py +28 -0
- mindspore/profiler/dynamic_profiler.py +694 -0
- mindspore/profiler/envprofiling.py +17 -19
- mindspore/profiler/parser/ascend_analysis/constant.py +18 -0
- mindspore/profiler/parser/ascend_analysis/file_manager.py +25 -4
- mindspore/profiler/parser/ascend_analysis/function_event.py +43 -19
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +31 -26
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +56 -10
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +55 -8
- mindspore/profiler/parser/ascend_analysis/path_manager.py +313 -0
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +27 -20
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +9 -2
- mindspore/profiler/parser/ascend_msprof_exporter.py +5 -4
- mindspore/profiler/parser/ascend_timeline_generator.py +27 -25
- mindspore/profiler/parser/base_timeline_generator.py +19 -25
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +25 -12
- mindspore/profiler/parser/framework_parser.py +1 -391
- mindspore/profiler/parser/gpu_analysis/__init__.py +14 -0
- mindspore/profiler/parser/gpu_analysis/function_event.py +44 -0
- mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +89 -0
- mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +72 -0
- mindspore/profiler/parser/memory_usage_parser.py +0 -154
- mindspore/profiler/parser/profiler_info.py +78 -6
- mindspore/profiler/profiler.py +153 -0
- mindspore/profiler/profiling.py +285 -413
- mindspore/rewrite/__init__.py +1 -2
- mindspore/rewrite/common/namespace.py +4 -4
- mindspore/rewrite/symbol_tree/symbol_tree.py +3 -3
- mindspore/run_check/_check_version.py +39 -104
- mindspore/safeguard/rewrite_obfuscation.py +591 -247
- mindspore/train/__init__.py +4 -3
- mindspore/train/_utils.py +105 -19
- mindspore/train/amp.py +171 -53
- mindspore/train/callback/__init__.py +2 -2
- mindspore/train/callback/_callback.py +4 -4
- mindspore/train/callback/_checkpoint.py +97 -31
- mindspore/train/callback/_cluster_monitor.py +1 -1
- mindspore/train/callback/_flops_collector.py +1 -0
- mindspore/train/callback/_loss_monitor.py +3 -3
- mindspore/train/callback/_on_request_exit.py +145 -31
- mindspore/train/callback/_summary_collector.py +5 -5
- mindspore/train/callback/_tft_register.py +375 -0
- mindspore/train/dataset_helper.py +15 -3
- mindspore/train/metrics/metric.py +3 -3
- mindspore/train/metrics/roc.py +4 -4
- mindspore/train/mind_ir_pb2.py +44 -39
- mindspore/train/model.py +154 -58
- mindspore/train/serialization.py +342 -128
- mindspore/utils/__init__.py +21 -0
- mindspore/utils/utils.py +60 -0
- mindspore/version.py +1 -1
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/METADATA +13 -7
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/RECORD +248 -242
- mindspore/include/c_api/ms/abstract.h +0 -67
- mindspore/include/c_api/ms/attribute.h +0 -197
- mindspore/include/c_api/ms/base/handle_types.h +0 -43
- mindspore/include/c_api/ms/base/macros.h +0 -32
- mindspore/include/c_api/ms/base/status.h +0 -33
- mindspore/include/c_api/ms/base/types.h +0 -283
- mindspore/include/c_api/ms/context.h +0 -102
- mindspore/include/c_api/ms/graph.h +0 -160
- mindspore/include/c_api/ms/node.h +0 -606
- mindspore/include/c_api/ms/tensor.h +0 -161
- mindspore/include/c_api/ms/value.h +0 -84
- mindspore/mindspore_shared_lib.dll +0 -0
- mindspore/nn/extend/basic.py +0 -140
- mindspore/nn/extend/embedding.py +0 -143
- mindspore/nn/extend/layer/normalization.py +0 -109
- mindspore/nn/extend/pooling.py +0 -117
- mindspore/nn/layer/embedding_service.py +0 -531
- mindspore/ops/_op_impl/aicpu/strided_slice_v2.py +0 -93
- mindspore/ops/_op_impl/aicpu/strided_slice_v2_grad.py +0 -66
- mindspore/ops/extend/__init__.py +0 -53
- mindspore/ops/extend/array_func.py +0 -218
- mindspore/ops/extend/math_func.py +0 -76
- mindspore/ops/extend/nn_func.py +0 -308
- mindspore/ops/silent_check.py +0 -162
- mindspore/profiler/parser/msadvisor_analyzer.py +0 -82
- mindspore/profiler/parser/msadvisor_parser.py +0 -240
- mindspore/train/callback/_mindio_ttp.py +0 -443
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/WHEEL +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/entry_points.txt +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/top_level.txt +0 -0
|
@@ -27,7 +27,7 @@ from ..core.validator_helpers import parse_user_args, type_check, type_check_lis
|
|
|
27
27
|
INT32_MAX, check_valid_detype, check_dir, check_file, check_sampler_shuffle_shard_options, \
|
|
28
28
|
validate_dataset_param_value, check_padding_options, \
|
|
29
29
|
check_num_parallel_workers, check_columns, check_pos_int32, check_valid_str, check_dataset_num_shards_shard_id, \
|
|
30
|
-
check_valid_list_tuple, check_int32
|
|
30
|
+
check_valid_list_tuple, check_int32, check_independent_mode
|
|
31
31
|
|
|
32
32
|
from . import datasets
|
|
33
33
|
from . import samplers
|
|
@@ -1035,6 +1035,7 @@ def check_minddataset(method):
|
|
|
1035
1035
|
check_sampler_shuffle_shard_options(param_dict)
|
|
1036
1036
|
|
|
1037
1037
|
check_padding_options(param_dict)
|
|
1038
|
+
check_cache_option(param_dict.get('cache'))
|
|
1038
1039
|
return method(self, *args, **kwargs)
|
|
1039
1040
|
|
|
1040
1041
|
return new_method
|
|
@@ -1114,7 +1115,9 @@ def check_generatordataset(method):
|
|
|
1114
1115
|
nreq_param_bool = ["shuffle", "python_multiprocessing"]
|
|
1115
1116
|
validate_dataset_param_value(nreq_param_bool, param_dict, bool)
|
|
1116
1117
|
|
|
1117
|
-
|
|
1118
|
+
max_rowsize = param_dict.get("max_rowsize")
|
|
1119
|
+
if max_rowsize is not None:
|
|
1120
|
+
check_value(max_rowsize, [-1, INT32_MAX], "max_rowsize")
|
|
1118
1121
|
|
|
1119
1122
|
num_shards = param_dict.get("num_shards")
|
|
1120
1123
|
shard_id = param_dict.get("shard_id")
|
|
@@ -1282,7 +1285,7 @@ def get_batch_kwargs_from_dict(param_dict):
|
|
|
1282
1285
|
input_columns = param_dict.get("input_columns", None)
|
|
1283
1286
|
output_columns = param_dict.get("output_columns", None)
|
|
1284
1287
|
python_multiprocessing = param_dict.get("python_multiprocessing", False)
|
|
1285
|
-
max_rowsize = param_dict.get("max_rowsize",
|
|
1288
|
+
max_rowsize = param_dict.get("max_rowsize", None)
|
|
1286
1289
|
return per_batch_map, input_columns, output_columns, python_multiprocessing, max_rowsize
|
|
1287
1290
|
|
|
1288
1291
|
|
|
@@ -1373,6 +1376,19 @@ def check_sync_wait(method):
|
|
|
1373
1376
|
type_check(condition_name, (str,), "condition_name")
|
|
1374
1377
|
type_check(num_batch, (int,), "num_batch")
|
|
1375
1378
|
|
|
1379
|
+
check_independent_mode("Dataset sync wait")
|
|
1380
|
+
|
|
1381
|
+
return method(self, *args, **kwargs)
|
|
1382
|
+
|
|
1383
|
+
return new_method
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
def check_sync_update(method):
|
|
1387
|
+
"""check the input arguments of sync_update."""
|
|
1388
|
+
|
|
1389
|
+
@wraps(method)
|
|
1390
|
+
def new_method(self, *args, **kwargs):
|
|
1391
|
+
check_independent_mode("Dataset sync update")
|
|
1376
1392
|
return method(self, *args, **kwargs)
|
|
1377
1393
|
|
|
1378
1394
|
return new_method
|
|
@@ -1398,7 +1414,7 @@ def get_map_kwargs_from_dict(param_dict):
|
|
|
1398
1414
|
"""get map operation kwargs parameters."""
|
|
1399
1415
|
if param_dict is not None:
|
|
1400
1416
|
python_multiprocessing = param_dict.get("python_multiprocessing", False)
|
|
1401
|
-
max_rowsize = param_dict.get("max_rowsize",
|
|
1417
|
+
max_rowsize = param_dict.get("max_rowsize", None)
|
|
1402
1418
|
cache = param_dict.get("cache", None)
|
|
1403
1419
|
callbacks = param_dict.get("callbacks", None)
|
|
1404
1420
|
offload = param_dict.get("offload", None)
|
|
@@ -1407,16 +1423,17 @@ def get_map_kwargs_from_dict(param_dict):
|
|
|
1407
1423
|
|
|
1408
1424
|
def check_max_rowsize(max_rowsize):
|
|
1409
1425
|
"""check the max_rowsize"""
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1426
|
+
if max_rowsize is not None:
|
|
1427
|
+
type_check(max_rowsize, (int, list), "max_rowsize")
|
|
1428
|
+
if isinstance(max_rowsize, int):
|
|
1429
|
+
type_check(max_rowsize, (int,), "max_rowsize")
|
|
1430
|
+
check_value(max_rowsize, [-1, INT32_MAX], "max_rowsize")
|
|
1431
|
+
elif isinstance(max_rowsize, list) and len(max_rowsize) == 2:
|
|
1432
|
+
for index, value in enumerate(max_rowsize):
|
|
1433
|
+
type_check(value, (int,), "max_rowsize[{}]".format(index))
|
|
1434
|
+
check_value(value, [-1, INT32_MAX], "max_rowsizei[{}]".format(index))
|
|
1435
|
+
else:
|
|
1436
|
+
raise TypeError("max_rowsize should be a single integer or a list[in_rowsize, out_rowsize] of length 2.")
|
|
1420
1437
|
|
|
1421
1438
|
|
|
1422
1439
|
def check_map(method):
|
|
@@ -1477,12 +1494,14 @@ def check_map(method):
|
|
|
1477
1494
|
check_max_rowsize(max_rowsize)
|
|
1478
1495
|
if offload is not None:
|
|
1479
1496
|
type_check(offload, (bool,), "offload")
|
|
1497
|
+
check_independent_mode("Dataset Offload", offload)
|
|
1480
1498
|
|
|
1481
1499
|
if callbacks is not None:
|
|
1482
1500
|
if isinstance(callbacks, (list, tuple)):
|
|
1483
1501
|
type_check_list(callbacks, (DSCallback,), "callbacks")
|
|
1484
1502
|
else:
|
|
1485
1503
|
type_check(callbacks, (DSCallback,), "callbacks")
|
|
1504
|
+
check_independent_mode("Dataset Callbacks")
|
|
1486
1505
|
|
|
1487
1506
|
for param_name, param in zip(nreq_param_columns, [input_columns, output_columns]):
|
|
1488
1507
|
if param is not None:
|
|
@@ -2020,6 +2039,7 @@ def check_cache_option(cache):
|
|
|
2020
2039
|
"""Sanity check for cache parameter"""
|
|
2021
2040
|
if cache is not None:
|
|
2022
2041
|
type_check(cache, (cache_client.DatasetCache,), "cache")
|
|
2042
|
+
check_independent_mode("Dataset Cache")
|
|
2023
2043
|
|
|
2024
2044
|
|
|
2025
2045
|
def check_to_device_send(method):
|
|
@@ -24,9 +24,6 @@ Common imported modules in corresponding API examples are as follows:
|
|
|
24
24
|
import mindspore.dataset as ds
|
|
25
25
|
import mindspore.dataset.text as text
|
|
26
26
|
|
|
27
|
-
See `Text Transforms
|
|
28
|
-
<https://www.mindspore.cn/tutorials/en/master/beginner/transforms.html#text-transforms>`_ tutorial for more details.
|
|
29
|
-
|
|
30
27
|
Descriptions of common data processing terms are as follows:
|
|
31
28
|
|
|
32
29
|
- TensorOperation, the base class of all data processing operations implemented in C++.
|
|
@@ -38,7 +35,7 @@ The data transform operation can be executed in the data processing pipeline or
|
|
|
38
35
|
`introduction to data processing pipeline <https://www.mindspore.cn/docs/en/master/api_python/
|
|
39
36
|
mindspore.dataset.html#introduction-to-data-processing-pipeline>`_ .
|
|
40
37
|
- Eager mode is more like a function call to process data. Examples refer to
|
|
41
|
-
`Lightweight Data Processing <https://www.mindspore.cn/
|
|
38
|
+
`Lightweight Data Processing <https://www.mindspore.cn/docs/en/master/model_train/dataset/eager.html>`_ .
|
|
42
39
|
"""
|
|
43
40
|
import platform
|
|
44
41
|
|
|
@@ -30,9 +30,6 @@ Note: Legacy c_transforms and py_transforms are deprecated but can still be impo
|
|
|
30
30
|
from mindspore.dataset.transforms import c_transforms
|
|
31
31
|
from mindspore.dataset.transforms import py_transforms
|
|
32
32
|
|
|
33
|
-
See `Common Transforms
|
|
34
|
-
<https://www.mindspore.cn/tutorials/en/master/beginner/transforms.html#common-transforms>`_ tutorial for more details.
|
|
35
|
-
|
|
36
33
|
Descriptions of common data processing terms are as follows:
|
|
37
34
|
|
|
38
35
|
- TensorOperation, the base class of all data processing operations implemented in C++.
|
|
@@ -31,9 +31,6 @@ Note: Legacy c_transforms and py_transforms are deprecated but can still be impo
|
|
|
31
31
|
import mindspore.dataset.vision.c_transforms as c_vision
|
|
32
32
|
import mindspore.dataset.vision.py_transforms as py_vision
|
|
33
33
|
|
|
34
|
-
See `Vision Transforms
|
|
35
|
-
<https://www.mindspore.cn/tutorials/en/master/beginner/transforms.html#vision-transforms>`_ tutorial for more details.
|
|
36
|
-
|
|
37
34
|
Descriptions of common data processing terms are as follows:
|
|
38
35
|
|
|
39
36
|
- TensorOperation, the base class of all data processing operations implemented in C++.
|
|
@@ -46,7 +43,7 @@ The data transform operation can be executed in the data processing pipeline or
|
|
|
46
43
|
`introduction to data processing pipeline <https://www.mindspore.cn/docs/en/master/api_python/
|
|
47
44
|
mindspore.dataset.html#introduction-to-data-processing-pipeline>`_ .
|
|
48
45
|
- Eager mode is more like a function call to process data. Examples refer to
|
|
49
|
-
`Lightweight Data Processing <https://www.mindspore.cn/
|
|
46
|
+
`Lightweight Data Processing <https://www.mindspore.cn/docs/en/master/model_train/dataset/eager.html>`_ .
|
|
50
47
|
"""
|
|
51
48
|
from . import c_transforms
|
|
52
49
|
from . import py_transforms
|
|
@@ -263,7 +263,7 @@ class ConvertMode(IntEnum):
|
|
|
263
263
|
|
|
264
264
|
mode = c_values.get(mode)
|
|
265
265
|
if mode is None:
|
|
266
|
-
raise RuntimeError("Unsupported ConvertMode, see https://www.mindspore.cn/docs/
|
|
266
|
+
raise RuntimeError("Unsupported ConvertMode, see https://www.mindspore.cn/docs/en/master/api_python/"
|
|
267
267
|
"dataset_vision/mindspore.dataset.vision.ConvertColor.html for more details.")
|
|
268
268
|
return mode
|
|
269
269
|
|
|
@@ -24,7 +24,7 @@ from mindspore.dataset.core.validator_helpers import check_value, check_uint8, F
|
|
|
24
24
|
check_pos_float32, check_float32, check_2tuple, check_range, check_positive, INT32_MAX, INT32_MIN, \
|
|
25
25
|
parse_user_args, type_check, type_check_list, check_c_tensor_op, UINT8_MAX, UINT8_MIN, check_value_normalize_std, \
|
|
26
26
|
check_value_cutoff, check_value_ratio, check_odd, check_non_negative_float32, check_non_negative_int32, \
|
|
27
|
-
check_pos_int32, check_int32, check_tensor_op, deprecator_factory, check_valid_str
|
|
27
|
+
check_pos_int32, check_int32, check_tensor_op, deprecator_factory, check_valid_str, check_independent_mode
|
|
28
28
|
from mindspore.dataset.transforms.validators import check_transform_op_type
|
|
29
29
|
from .utils import Inter, Border, ImageBatchFormat, ConvertMode, SliceMode, AutoAugmentPolicy
|
|
30
30
|
|
|
@@ -358,6 +358,7 @@ def check_device_target(method):
|
|
|
358
358
|
def new_method(self, *args, **kwargs):
|
|
359
359
|
[device_target], _ = parse_user_args(method, *args, **kwargs)
|
|
360
360
|
check_valid_str(device_target, ["CPU", "Ascend"], "device_target")
|
|
361
|
+
check_independent_mode("Transform in Ascend mode", (device_target == "Ascend"))
|
|
361
362
|
return method(self, *args, **kwargs)
|
|
362
363
|
return new_method
|
|
363
364
|
|
|
@@ -12,18 +12,11 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ============================================================================
|
|
15
|
-
"""
|
|
16
|
-
nn Extend.
|
|
17
|
-
"""
|
|
15
|
+
"""Experimental module for EmbeddingService."""
|
|
18
16
|
from __future__ import absolute_import
|
|
19
17
|
|
|
20
|
-
from mindspore.
|
|
21
|
-
from mindspore.
|
|
22
|
-
from mindspore.nn.extend.pooling import MaxPool2d
|
|
23
|
-
from mindspore.nn.extend import layer
|
|
24
|
-
from mindspore.nn.extend.layer import *
|
|
18
|
+
from mindspore.experimental.es.embedding_service import EmbeddingService
|
|
19
|
+
from mindspore.experimental.es.embedding_service_layer import EsEmbeddingLookup, ESEmbeddingSmallTableLookup
|
|
25
20
|
|
|
26
|
-
__all__ = ['Embedding', 'Linear', 'MaxPool2d']
|
|
27
|
-
__all__.extend(layer.__all__)
|
|
28
21
|
|
|
29
|
-
__all__
|
|
22
|
+
__all__ = ['EmbeddingService', 'EsEmbeddingLookup', 'ESEmbeddingSmallTableLookup']
|