mindspore 2.1.0__cp38-cp38-manylinux1_x86_64.whl → 2.2.0__cp38-cp38-manylinux1_x86_64.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 +4 -1
- mindspore/_akg/akg/build_module.py +5 -6
- mindspore/_akg/akg/composite/build_module.py +49 -16
- mindspore/_akg/akg/composite/split_stitch.py +10 -11
- mindspore/_akg/akg/ms/info_version_adapt.py +67 -1
- mindspore/_akg/akg/tvm/api.py +4 -3
- mindspore/_akg/akg/tvm/autotvm/__init__.py +1 -2
- mindspore/_akg/akg/tvm/autotvm/graph_tuner/base_graph_tuner.py +1 -5
- mindspore/_akg/akg/tvm/autotvm/measure/__init__.py +1 -1
- mindspore/_akg/akg/tvm/autotvm/measure/measure.py +1 -10
- mindspore/_akg/akg/tvm/autotvm/measure/measure_methods.py +1 -372
- mindspore/_akg/akg/tvm/build_module.py +16 -1
- mindspore/_akg/akg/tvm/contrib/graph_runtime.py +0 -53
- mindspore/_akg/akg/tvm/hybrid/parser.py +7 -6
- mindspore/_akg/akg/tvm/ir_builder.py +1 -1
- mindspore/_akg/akg/tvm/module.py +1 -2
- mindspore/_akg/akg/tvm/stmt.py +2 -2
- mindspore/_akg/akg/utils/composite_op_helper.py +9 -10
- mindspore/_akg/akg/utils/kernel_exec.py +58 -260
- mindspore/_akg/akg/utils/result_analysis.py +4 -24
- mindspore/_akg/akg/utils/tbe_codegen_utils.py +198 -0
- mindspore/_c_dataengine.cpython-38-x86_64-linux-gnu.so +0 -0
- mindspore/_c_expression.cpython-38-x86_64-linux-gnu.so +0 -0
- mindspore/_c_mindrecord.cpython-38-x86_64-linux-gnu.so +0 -0
- mindspore/_check_jit_forbidden_api.py +3 -1
- mindspore/_checkparam.py +26 -32
- mindspore/_extends/graph_kernel/__init__.py +0 -1
- mindspore/_extends/graph_kernel/model/model_builder.py +9 -50
- mindspore/_extends/graph_kernel/splitter.py +1 -9
- mindspore/_extends/parallel_compile/akg_compiler/akg_process.py +122 -15
- mindspore/_extends/parallel_compile/akg_compiler/build_tbe_kernel.py +2 -2
- mindspore/_extends/parallel_compile/akg_compiler/tbe_topi.py +4 -2
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py +2 -2
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +4 -4
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py +1 -1
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job_manager.py +1 -1
- mindspore/_extends/parse/__init__.py +12 -15
- mindspore/_extends/parse/namespace.py +7 -33
- mindspore/_extends/parse/parser.py +61 -71
- mindspore/_extends/parse/resources.py +1 -1
- mindspore/_extends/parse/standard_method.py +72 -95
- mindspore/_extends/parse/trope.py +1 -1
- mindspore/_extends/remote/kernel_build_server.py +24 -7
- mindspore/_extends/remote/kernel_build_server_akg_v2.py +55 -0
- mindspore/_install_custom.py +43 -0
- mindspore/_mindspore_offline_debug.cpython-38-x86_64-linux-gnu.so +0 -0
- mindspore/amp.py +47 -11
- mindspore/bin/cache_admin +0 -0
- mindspore/bin/cache_server +0 -0
- mindspore/boost/boost.py +1 -8
- mindspore/boost/boost_cell_wrapper.py +3 -2
- mindspore/boost/grad_accumulation.py +1 -1
- mindspore/boost/group_loss_scale_manager.py +8 -7
- mindspore/common/__init__.py +5 -3
- mindspore/common/_jit_fallback_utils.py +6 -0
- mindspore/common/_register_for_adapter.py +2 -0
- mindspore/common/_register_for_tensor.py +2 -2
- mindspore/common/_stub_tensor.py +13 -0
- mindspore/common/_utils.py +13 -0
- mindspore/common/api.py +173 -258
- mindspore/common/auto_dynamic_shape.py +498 -0
- mindspore/common/dtype.py +18 -11
- mindspore/common/dump.py +6 -4
- mindspore/common/initializer.py +14 -14
- mindspore/common/jit_config.py +33 -15
- mindspore/common/lazy_inline.py +126 -7
- mindspore/common/mindir_util.py +101 -0
- mindspore/common/parameter.py +51 -41
- mindspore/common/seed.py +4 -4
- mindspore/common/sparse_tensor.py +13 -14
- mindspore/common/tensor.py +240 -145
- mindspore/communication/__init__.py +7 -4
- mindspore/communication/_comm_helper.py +83 -4
- mindspore/communication/management.py +152 -84
- mindspore/config/op_info.config +13 -2
- mindspore/config/super_bar_config.json +4 -2
- mindspore/context.py +143 -59
- mindspore/dataset/__init__.py +5 -5
- mindspore/dataset/audio/__init__.py +2 -2
- mindspore/dataset/audio/transforms.py +52 -52
- mindspore/dataset/callback/ds_callback.py +16 -2
- mindspore/dataset/core/config.py +68 -51
- mindspore/dataset/engine/cache_client.py +28 -5
- mindspore/dataset/engine/datasets.py +250 -112
- mindspore/dataset/engine/datasets_audio.py +43 -211
- mindspore/dataset/engine/datasets_standard_format.py +11 -35
- mindspore/dataset/engine/datasets_text.py +43 -67
- mindspore/dataset/engine/datasets_user_defined.py +86 -100
- mindspore/dataset/engine/datasets_vision.py +219 -1029
- mindspore/dataset/engine/iterators.py +11 -4
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +4 -0
- mindspore/dataset/engine/obs/util.py +3 -0
- mindspore/dataset/engine/samplers.py +1 -1
- mindspore/dataset/engine/validators.py +19 -5
- mindspore/dataset/text/__init__.py +3 -3
- mindspore/dataset/text/transforms.py +101 -127
- mindspore/dataset/text/utils.py +205 -138
- mindspore/dataset/transforms/__init__.py +1 -1
- mindspore/dataset/transforms/py_transforms_util.py +40 -12
- mindspore/dataset/transforms/transforms.py +95 -40
- mindspore/dataset/utils/browse_dataset.py +8 -2
- mindspore/dataset/utils/line_reader.py +17 -19
- mindspore/dataset/vision/__init__.py +3 -3
- mindspore/dataset/vision/c_transforms.py +6 -3
- mindspore/dataset/vision/transforms.py +409 -287
- mindspore/dataset/vision/utils.py +13 -14
- mindspore/dataset/vision/validators.py +11 -1
- mindspore/experimental/map_parameter.py +14 -0
- mindspore/{nn/optim_ex → experimental/optim}/__init__.py +30 -29
- mindspore/{nn/optim_ex → experimental/optim}/adam.py +59 -66
- mindspore/{nn/optim_ex → experimental/optim}/adamw.py +181 -203
- mindspore/experimental/optim/lr_scheduler.py +1427 -0
- mindspore/{nn/optim_ex → experimental/optim}/optimizer.py +252 -259
- mindspore/{nn/optim_ex → experimental/optim}/sgd.py +147 -152
- mindspore/gen_ops.py +273 -0
- mindspore/include/OWNERS +0 -1
- mindspore/include/api/data_type.h +2 -1
- mindspore/include/api/graph.h +0 -15
- mindspore/include/api/kernel.h +2 -0
- mindspore/include/api/kernel_api.h +37 -12
- mindspore/include/api/model.h +0 -14
- mindspore/include/api/types.h +37 -4
- mindspore/include/c_api/ms/abstract.h +67 -0
- mindspore/include/c_api/ms/attribute.h +197 -0
- mindspore/include/c_api/ms/base/handle_types.h +43 -0
- mindspore/include/c_api/ms/base/macros.h +32 -0
- mindspore/include/c_api/ms/base/status.h +33 -0
- mindspore/include/c_api/ms/base/types.h +282 -0
- mindspore/include/c_api/ms/context.h +102 -0
- mindspore/include/c_api/ms/graph.h +160 -0
- mindspore/include/c_api/ms/node.h +606 -0
- mindspore/include/c_api/ms/tensor.h +161 -0
- mindspore/include/c_api/ms/value.h +84 -0
- mindspore/include/dataset/constants.h +6 -5
- mindspore/include/dataset/execute.h +23 -13
- mindspore/include/dataset/text.h +26 -26
- mindspore/include/dataset/transforms.h +13 -13
- mindspore/include/dataset/vision.h +60 -60
- mindspore/include/dataset/vision_ascend.h +5 -6
- mindspore/include/dataset/vision_lite.h +17 -17
- mindspore/include/mindapi/base/type_id.h +1 -0
- mindspore/include/mindapi/base/types.h +1 -0
- mindspore/lib/libdnnl.so.2 +0 -0
- mindspore/lib/libjemalloc.so.2 +0 -0
- mindspore/lib/libmindspore.so +0 -0
- mindspore/lib/libmindspore_backend.so +0 -0
- mindspore/lib/libmindspore_common.so +0 -0
- mindspore/lib/libmindspore_core.so +0 -0
- mindspore/lib/libmindspore_glog.so.0 +0 -0
- mindspore/lib/libmindspore_gpr.so.15 +0 -0
- mindspore/lib/libmindspore_grpc++.so.1 +0 -0
- mindspore/lib/libmindspore_grpc.so.15 +0 -0
- mindspore/lib/libmindspore_shared_lib.so +0 -0
- mindspore/lib/libnnacl.so +0 -0
- mindspore/lib/libopencv_core.so.4.5 +0 -0
- mindspore/lib/libopencv_imgcodecs.so.4.5 +0 -0
- mindspore/lib/libopencv_imgproc.so.4.5 +0 -0
- mindspore/lib/libps_cache.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_aicpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +9000 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
- mindspore/lib/plugin/ascend/libakg.so +0 -0
- mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
- mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
- mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
- mindspore/lib/plugin/ascend/libmindspore_aicpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
- mindspore/lib/plugin/cpu/libakg.so +0 -0
- mindspore/lib/plugin/gpu/libcuda_ops.so.10 +0 -0
- mindspore/lib/plugin/gpu/libcuda_ops.so.11 +0 -0
- mindspore/lib/plugin/gpu10.1/libakg.so +0 -0
- mindspore/lib/plugin/gpu10.1/libnccl.so.2 +0 -0
- mindspore/lib/plugin/gpu11.1/libakg.so +0 -0
- mindspore/lib/plugin/gpu11.1/libnccl.so.2 +0 -0
- mindspore/lib/plugin/gpu11.6/libakg.so +0 -0
- mindspore/lib/plugin/gpu11.6/libnccl.so.2 +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.1 +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.10.1 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.11.1 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.11.6 +0 -0
- mindspore/mindrecord/tools/imagenet_to_mr.py +1 -1
- mindspore/mindrecord/tools/mnist_to_mr.py +2 -2
- mindspore/nn/__init__.py +0 -2
- mindspore/nn/cell.py +316 -74
- mindspore/nn/dynamic_lr.py +21 -21
- mindspore/nn/layer/activation.py +21 -28
- mindspore/nn/layer/basic.py +15 -13
- mindspore/nn/layer/channel_shuffle.py +1 -1
- mindspore/nn/layer/container.py +271 -9
- mindspore/nn/layer/conv.py +310 -207
- mindspore/nn/layer/dense.py +8 -5
- mindspore/nn/layer/embedding.py +33 -27
- mindspore/nn/layer/flash_attention.py +82 -41
- mindspore/nn/layer/image.py +8 -6
- mindspore/nn/layer/math.py +13 -18
- mindspore/nn/layer/normalization.py +107 -66
- mindspore/nn/layer/padding.py +1 -1
- mindspore/nn/layer/pooling.py +131 -109
- mindspore/nn/layer/rnn_cells.py +22 -17
- mindspore/nn/layer/rnns.py +13 -16
- mindspore/nn/layer/thor_layer.py +1 -1
- mindspore/nn/layer/transformer.py +221 -154
- mindspore/nn/learning_rate_schedule.py +9 -1
- mindspore/nn/loss/loss.py +235 -174
- mindspore/nn/optim/ada_grad.py +2 -1
- mindspore/nn/optim/adadelta.py +1 -0
- mindspore/nn/optim/adafactor.py +2 -1
- mindspore/nn/optim/adam.py +7 -4
- mindspore/nn/optim/adamax.py +3 -2
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/asgd.py +2 -3
- mindspore/nn/optim/ftrl.py +6 -5
- mindspore/nn/optim/lamb.py +7 -4
- mindspore/nn/optim/lars.py +1 -1
- mindspore/nn/optim/lazyadam.py +5 -3
- mindspore/nn/optim/momentum.py +2 -1
- mindspore/nn/optim/optimizer.py +53 -4
- mindspore/nn/optim/proximal_ada_grad.py +3 -4
- mindspore/nn/optim/rmsprop.py +4 -3
- mindspore/nn/optim/rprop.py +23 -12
- mindspore/nn/optim/sgd.py +26 -11
- mindspore/nn/optim/thor.py +9 -7
- mindspore/nn/probability/bijector/bijector.py +5 -5
- mindspore/nn/probability/bijector/power_transform.py +27 -27
- mindspore/nn/probability/bijector/softplus.py +3 -3
- mindspore/nn/probability/distribution/_utils/custom_ops.py +3 -3
- mindspore/nn/probability/distribution/bernoulli.py +5 -5
- mindspore/nn/probability/distribution/beta.py +3 -3
- mindspore/nn/probability/distribution/categorical.py +7 -7
- mindspore/nn/probability/distribution/cauchy.py +0 -1
- mindspore/nn/probability/distribution/distribution.py +3 -3
- mindspore/nn/probability/distribution/gamma.py +3 -3
- mindspore/nn/probability/distribution/geometric.py +4 -4
- mindspore/nn/probability/distribution/gumbel.py +4 -4
- mindspore/nn/probability/distribution/log_normal.py +2 -2
- mindspore/nn/probability/distribution/logistic.py +2 -2
- mindspore/nn/probability/distribution/poisson.py +4 -4
- mindspore/nn/probability/distribution/transformed_distribution.py +3 -3
- mindspore/nn/probability/distribution/uniform.py +6 -6
- mindspore/nn/wrap/cell_wrapper.py +78 -34
- mindspore/nn/wrap/grad_reducer.py +8 -5
- mindspore/nn/wrap/loss_scale.py +105 -42
- mindspore/numpy/array_creations.py +1 -2
- mindspore/numpy/array_ops.py +3 -2
- mindspore/offline_debug/convert_async.py +2 -2
- mindspore/ops/_grad_experimental/__init__.py +0 -5
- mindspore/ops/_grad_experimental/grad_array_ops.py +1 -2
- mindspore/ops/_grad_experimental/grad_comm_ops.py +15 -2
- mindspore/ops/_grad_experimental/grad_debug_ops.py +0 -37
- mindspore/ops/_grad_experimental/grad_implementations.py +10 -0
- mindspore/ops/_grad_experimental/grad_inner_ops.py +2 -216
- mindspore/ops/_grad_experimental/grad_math_ops.py +0 -181
- mindspore/ops/_grad_experimental/grad_sparse.py +15 -0
- mindspore/ops/_op_impl/_custom_op/dsd_back_impl.py +1 -1
- mindspore/ops/_op_impl/_custom_op/flash_attention/attention.py +165 -109
- mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_bwd.py +144 -86
- mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_fwd.py +172 -187
- mindspore/ops/_op_impl/_custom_op/flash_attention/flash_attention_impl.py +51 -57
- mindspore/ops/_op_impl/_custom_op/flash_attention/tik_ops_utils.py +6 -17
- mindspore/ops/_op_impl/_custom_op/flash_attention/tiling_strategy/wukong_tiling.py +1 -1
- mindspore/ops/_op_impl/aicpu/__init__.py +14 -2
- mindspore/ops/_op_impl/aicpu/bias_add_grad.py +0 -1
- mindspore/ops/_op_impl/aicpu/count_nonzero.py +43 -0
- mindspore/ops/_op_impl/aicpu/eps.py +32 -0
- mindspore/ops/_op_impl/aicpu/gamma.py +2 -2
- mindspore/ops/_op_impl/aicpu/log_uniform_candidate_sampler.py +6 -3
- mindspore/ops/_op_impl/aicpu/lu_unpack_grad.py +0 -1
- mindspore/ops/_op_impl/aicpu/multinomial.py +3 -3
- mindspore/ops/_op_impl/aicpu/parameterized_truncated_normal.py +15 -7
- mindspore/ops/_op_impl/aicpu/random_categorical.py +39 -19
- mindspore/ops/_op_impl/aicpu/random_choice_with_mask.py +5 -2
- mindspore/ops/_op_impl/aicpu/random_poisson.py +103 -52
- mindspore/ops/_op_impl/aicpu/random_shuffle.py +17 -15
- mindspore/ops/_op_impl/aicpu/{sparseaddmm.py → sparse_addmm.py} +2 -2
- mindspore/ops/_op_impl/aicpu/{sparsesparsemaximum.py → sparse_sparse_maximum.py} +4 -4
- mindspore/ops/_op_impl/aicpu/standard_laplace.py +5 -5
- mindspore/ops/_op_impl/aicpu/standard_normal.py +5 -5
- mindspore/ops/_op_impl/aicpu/truncated_normal.py +9 -7
- mindspore/ops/_op_impl/aicpu/uniform.py +5 -3
- mindspore/ops/_op_impl/aicpu/uniform_candidate_sampler.py +8 -4
- mindspore/ops/_op_impl/aicpu/uniform_int.py +5 -5
- mindspore/ops/_op_impl/aicpu/uniform_real.py +4 -4
- mindspore/ops/_op_impl/tbe/__init__.py +4 -4
- mindspore/ops/_op_impl/tbe/inplace_index_add.py +7 -3
- mindspore/ops/_op_impl/tbe/trans_data_ds.py +2 -0
- mindspore/ops/_primitive_cache.py +1 -1
- mindspore/ops/_tracefunc.py +45 -13
- mindspore/ops/_utils/utils.py +4 -1
- mindspore/ops/_vmap/vmap_array_ops.py +3 -3
- mindspore/ops/_vmap/vmap_base.py +3 -3
- mindspore/ops/_vmap/vmap_convolution_ops.py +1 -1
- mindspore/ops/_vmap/vmap_grad_math_ops.py +6 -4
- mindspore/ops/_vmap/vmap_math_ops.py +5 -2
- mindspore/ops/_vmap/vmap_nn_ops.py +61 -7
- mindspore/ops/arg_dtype_cast.py +54 -0
- mindspore/ops/composite/base.py +37 -10
- mindspore/ops/composite/math_ops.py +5 -4
- mindspore/ops/composite/multitype_ops/_compile_utils.py +273 -72
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +16 -9
- mindspore/ops/composite/multitype_ops/add_impl.py +43 -4
- mindspore/ops/composite/multitype_ops/getitem_impl.py +40 -2
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +9 -0
- mindspore/ops/deprecated.py +304 -0
- mindspore/ops/function/__init__.py +4 -1
- mindspore/ops/function/array_func.py +167 -189
- mindspore/ops/function/clip_func.py +81 -13
- mindspore/ops/function/debug_func.py +1 -1
- mindspore/ops/function/grad/grad_func.py +18 -8
- mindspore/ops/function/image_func.py +10 -4
- mindspore/ops/function/linalg_func.py +5 -5
- mindspore/ops/function/math_func.py +575 -386
- mindspore/ops/function/nn_func.py +470 -251
- mindspore/ops/function/random_func.py +86 -56
- mindspore/ops/function/sparse_func.py +1 -1
- mindspore/ops/function/sparse_unary_func.py +14 -12
- mindspore/ops/function/vmap_func.py +6 -5
- mindspore/ops/functional.py +15 -10
- mindspore/ops/op_info_register.py +235 -19
- mindspore/ops/operations/__init__.py +25 -17
- mindspore/ops/operations/_grad_ops.py +52 -7
- mindspore/ops/operations/_inner_ops.py +213 -12
- mindspore/ops/operations/_quant_ops.py +4 -8
- mindspore/ops/operations/_sequence_ops.py +42 -0
- mindspore/ops/operations/array_ops.py +64 -280
- mindspore/ops/operations/comm_ops.py +105 -57
- mindspore/ops/operations/custom_ops.py +10 -3
- mindspore/ops/operations/debug_ops.py +8 -4
- mindspore/ops/operations/image_ops.py +18 -12
- mindspore/ops/operations/math_ops.py +185 -138
- mindspore/ops/operations/nn_ops.py +716 -492
- mindspore/ops/operations/other_ops.py +0 -22
- mindspore/ops/operations/random_ops.py +53 -111
- mindspore/ops/operations/sparse_ops.py +3 -1
- mindspore/ops/primitive.py +24 -18
- mindspore/parallel/_auto_parallel_context.py +68 -8
- mindspore/parallel/_cost_model_context.py +2 -2
- mindspore/parallel/_offload_context.py +17 -3
- mindspore/parallel/_parallel_serialization.py +2 -2
- mindspore/parallel/_ps_context.py +12 -0
- mindspore/parallel/_tensor.py +14 -12
- mindspore/parallel/_transformer/layers.py +5 -3
- mindspore/parallel/_transformer/loss.py +1 -0
- mindspore/parallel/_transformer/moe.py +2 -2
- mindspore/parallel/_transformer/op_parallel_config.py +12 -1
- mindspore/parallel/_transformer/transformer.py +23 -3
- mindspore/parallel/_utils.py +11 -7
- mindspore/parallel/algo_parameter_config.py +85 -5
- mindspore/parallel/checkpoint_transform.py +6 -10
- mindspore/parallel/shard.py +4 -4
- mindspore/profiler/common/struct_type.py +3 -3
- mindspore/profiler/common/util.py +3 -2
- mindspore/profiler/envprofiling.py +1 -1
- mindspore/profiler/parser/aicpu_data_parser.py +5 -3
- mindspore/profiler/parser/ascend_flops_generator.py +2 -2
- mindspore/profiler/parser/ascend_fpbp_generator.py +1 -1
- mindspore/profiler/parser/ascend_hccl_generator.py +17 -12
- mindspore/profiler/parser/ascend_msprof_exporter.py +104 -252
- mindspore/profiler/parser/ascend_msprof_generator.py +8 -8
- mindspore/profiler/parser/ascend_op_generator.py +5 -5
- mindspore/profiler/parser/ascend_steptrace_generator.py +6 -4
- mindspore/profiler/parser/ascend_timeline_generator.py +9 -6
- mindspore/profiler/parser/base_timeline_generator.py +9 -7
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +14 -10
- mindspore/profiler/parser/flops_parser.py +15 -11
- mindspore/profiler/parser/framework_parser.py +37 -21
- mindspore/profiler/parser/hccl_parser.py +16 -12
- mindspore/profiler/parser/integrator.py +22 -11
- mindspore/profiler/parser/memory_usage_parser.py +2 -2
- mindspore/profiler/parser/minddata_analyzer.py +12 -14
- mindspore/profiler/parser/minddata_pipeline_parser.py +1 -1
- mindspore/profiler/parser/msadvisor_parser.py +8 -4
- mindspore/profiler/parser/op_intermediate_parser.py +5 -2
- mindspore/profiler/parser/optime_parser.py +1 -1
- mindspore/profiler/parser/profiler_info.py +2 -2
- mindspore/profiler/parser/step_trace_parser.py +11 -14
- mindspore/profiler/profiling.py +139 -71
- mindspore/rewrite/api/node.py +102 -19
- mindspore/rewrite/api/node_type.py +5 -1
- mindspore/rewrite/api/scoped_value.py +9 -17
- mindspore/rewrite/api/symbol_tree.py +131 -47
- mindspore/rewrite/ast_helpers/__init__.py +2 -1
- mindspore/rewrite/ast_helpers/ast_finder.py +129 -0
- mindspore/rewrite/ast_helpers/ast_modifier.py +116 -104
- mindspore/rewrite/ast_transformers/flatten_recursive_stmt.py +93 -46
- mindspore/rewrite/common/rewrite_elog.py +5 -1
- mindspore/rewrite/namer.py +33 -24
- mindspore/rewrite/namespace.py +14 -5
- mindspore/{_extends/graph_kernel/expanders/complex → rewrite/node}/__init__.py +9 -9
- mindspore/rewrite/node/call_function.py +79 -0
- mindspore/rewrite/node/cell_container.py +135 -0
- mindspore/rewrite/node/control_flow.py +88 -0
- mindspore/rewrite/{node.py → node/node.py} +273 -234
- mindspore/rewrite/node/node_manager.py +254 -0
- mindspore/rewrite/{topological_manager.py → node/node_topological_manager.py} +13 -46
- mindspore/rewrite/parsers/arguments_parser.py +22 -21
- mindspore/rewrite/parsers/assign_parser.py +216 -221
- mindspore/rewrite/parsers/attribute_parser.py +9 -7
- mindspore/rewrite/parsers/class_def_parser.py +174 -113
- mindspore/rewrite/parsers/constant_parser.py +9 -6
- mindspore/rewrite/parsers/container_parser.py +9 -7
- mindspore/rewrite/parsers/for_parser.py +36 -15
- mindspore/rewrite/parsers/function_def_parser.py +24 -16
- mindspore/rewrite/parsers/if_parser.py +28 -24
- mindspore/rewrite/parsers/module_parser.py +196 -25
- mindspore/rewrite/{parser.py → parsers/parser.py} +4 -2
- mindspore/rewrite/{parser_register.py → parsers/parser_register.py} +1 -1
- mindspore/rewrite/parsers/return_parser.py +6 -6
- mindspore/rewrite/sparsify/sparse_transformer.py +12 -3
- mindspore/rewrite/sparsify/utils.py +1 -1
- mindspore/rewrite/symbol_tree.py +525 -577
- mindspore/rewrite/symbol_tree_builder.py +9 -193
- mindspore/rewrite/symbol_tree_dumper.py +2 -2
- mindspore/run_check/_check_version.py +2 -2
- mindspore/{ops/bprop_mindir → safeguard}/__init__.py +4 -3
- mindspore/safeguard/rewrite_obfuscation.py +517 -0
- mindspore/scipy/linalg.py +1 -1
- mindspore/scipy/optimize/minimize.py +7 -3
- mindspore/train/_utils.py +7 -3
- mindspore/train/amp.py +323 -123
- mindspore/train/anf_ir_pb2.py +14 -2
- mindspore/train/callback/_backup_and_restore.py +2 -12
- mindspore/train/callback/_callback.py +29 -4
- mindspore/train/callback/_checkpoint.py +23 -8
- mindspore/train/callback/_early_stop.py +2 -2
- mindspore/train/callback/_landscape.py +4 -4
- mindspore/train/callback/_loss_monitor.py +2 -2
- mindspore/train/callback/_on_request_exit.py +2 -2
- mindspore/train/callback/_reduce_lr_on_plateau.py +3 -4
- mindspore/train/callback/_summary_collector.py +14 -7
- mindspore/train/callback/_time_monitor.py +58 -5
- mindspore/train/data_sink.py +5 -11
- mindspore/train/dataset_helper.py +83 -57
- mindspore/train/loss_scale_manager.py +2 -2
- mindspore/train/metrics/__init__.py +3 -3
- mindspore/train/metrics/cosine_similarity.py +1 -1
- mindspore/train/metrics/hausdorff_distance.py +3 -2
- mindspore/train/metrics/mean_surface_distance.py +3 -2
- mindspore/train/metrics/metric.py +39 -19
- mindspore/train/metrics/roc.py +2 -2
- mindspore/train/metrics/root_mean_square_surface_distance.py +4 -3
- mindspore/train/mind_ir_pb2.py +85 -36
- mindspore/train/model.py +185 -45
- mindspore/train/serialization.py +390 -150
- mindspore/train/summary/_writer_pool.py +3 -2
- mindspore/train/summary/summary_record.py +14 -10
- mindspore/train/train_thor/convert_utils.py +3 -3
- mindspore/train/train_thor/dataset_helper.py +1 -1
- mindspore/version.py +1 -1
- {mindspore-2.1.0.dist-info → mindspore-2.2.0.dist-info}/METADATA +6 -7
- {mindspore-2.1.0.dist-info → mindspore-2.2.0.dist-info}/RECORD +458 -518
- {mindspore-2.1.0.dist-info → mindspore-2.2.0.dist-info}/entry_points.txt +0 -1
- mindspore/_akg/akg/tvm/contrib/debugger/__init__.py +0 -16
- mindspore/_akg/akg/tvm/contrib/debugger/debug_result.py +0 -274
- mindspore/_akg/akg/tvm/contrib/debugger/debug_runtime.py +0 -259
- mindspore/_akg/akg/tvm/contrib/peak.py +0 -341
- mindspore/_akg/akg/tvm/contrib/rpc.py +0 -25
- mindspore/_akg/akg/tvm/contrib/xcode.py +0 -257
- mindspore/_akg/akg/tvm/exec/__init__.py +0 -17
- mindspore/_akg/akg/tvm/exec/autotvm_log_editor.py +0 -60
- mindspore/_akg/akg/tvm/exec/measure_peak.py +0 -48
- mindspore/_akg/akg/tvm/exec/query_rpc_tracker.py +0 -48
- mindspore/_akg/akg/tvm/exec/rpc_proxy.py +0 -98
- mindspore/_akg/akg/tvm/exec/rpc_server.py +0 -88
- mindspore/_akg/akg/tvm/exec/rpc_tracker.py +0 -62
- mindspore/_akg/akg/tvm/rpc/__init__.py +0 -29
- mindspore/_akg/akg/tvm/rpc/base.py +0 -182
- mindspore/_akg/akg/tvm/rpc/client.py +0 -436
- mindspore/_akg/akg/tvm/rpc/proxy.py +0 -595
- mindspore/_akg/akg/tvm/rpc/server.py +0 -413
- mindspore/_akg/akg/tvm/rpc/tornado_util.py +0 -121
- mindspore/_akg/akg/tvm/rpc/tracker.py +0 -431
- mindspore/_extends/graph_kernel/expander.py +0 -80
- mindspore/_extends/graph_kernel/expanders/__init__.py +0 -54
- mindspore/_extends/graph_kernel/expanders/_utils.py +0 -269
- mindspore/_extends/graph_kernel/expanders/addn.py +0 -33
- mindspore/_extends/graph_kernel/expanders/batchnorm.py +0 -152
- mindspore/_extends/graph_kernel/expanders/batchnorm_grad.py +0 -105
- mindspore/_extends/graph_kernel/expanders/clip_by_norm_no_div_sum.py +0 -33
- mindspore/_extends/graph_kernel/expanders/complex/abs.py +0 -30
- mindspore/_extends/graph_kernel/expanders/complex/add.py +0 -44
- mindspore/_extends/graph_kernel/expanders/complex/div.py +0 -62
- mindspore/_extends/graph_kernel/expanders/complex/mul.py +0 -52
- mindspore/_extends/graph_kernel/expanders/complex/real_div.py +0 -62
- mindspore/_extends/graph_kernel/expanders/complex/sub.py +0 -45
- mindspore/_extends/graph_kernel/expanders/conv2d.py +0 -200
- mindspore/_extends/graph_kernel/expanders/dropout_grad.py +0 -30
- mindspore/_extends/graph_kernel/expanders/equal_count.py +0 -50
- mindspore/_extends/graph_kernel/expanders/erfc.py +0 -35
- mindspore/_extends/graph_kernel/expanders/expand_dims.py +0 -50
- mindspore/_extends/graph_kernel/expanders/fused_adam.py +0 -44
- mindspore/_extends/graph_kernel/expanders/fused_adam_weight_decay.py +0 -47
- mindspore/_extends/graph_kernel/expanders/fused_mul_add.py +0 -28
- mindspore/_extends/graph_kernel/expanders/gelu_grad.py +0 -70
- mindspore/_extends/graph_kernel/expanders/gkdropout.py +0 -40
- mindspore/_extends/graph_kernel/expanders/identity.py +0 -25
- mindspore/_extends/graph_kernel/expanders/layernorm.py +0 -93
- mindspore/_extends/graph_kernel/expanders/layernorm_grad.py +0 -113
- mindspore/_extends/graph_kernel/expanders/logsoftmax.py +0 -46
- mindspore/_extends/graph_kernel/expanders/logsoftmax_grad.py +0 -36
- mindspore/_extends/graph_kernel/expanders/matmul.py +0 -80
- mindspore/_extends/graph_kernel/expanders/maximum_grad.py +0 -59
- mindspore/_extends/graph_kernel/expanders/minimum_grad.py +0 -80
- mindspore/_extends/graph_kernel/expanders/oneslike.py +0 -26
- mindspore/_extends/graph_kernel/expanders/reduce_mean.py +0 -43
- mindspore/_extends/graph_kernel/expanders/relu_grad.py +0 -32
- mindspore/_extends/graph_kernel/expanders/sigmoid_cross_entropy_with_logits.py +0 -41
- mindspore/_extends/graph_kernel/expanders/sigmoid_cross_entropy_with_logits_grad.py +0 -35
- mindspore/_extends/graph_kernel/expanders/sigmoid_grad.py +0 -31
- mindspore/_extends/graph_kernel/expanders/slice.py +0 -35
- mindspore/_extends/graph_kernel/expanders/softmax_cross_entropy_with_logits.py +0 -42
- mindspore/_extends/graph_kernel/expanders/softmax_grad_ext.py +0 -41
- mindspore/_extends/graph_kernel/expanders/softsign.py +0 -28
- mindspore/_extends/graph_kernel/expanders/sqrt_grad.py +0 -29
- mindspore/_extends/graph_kernel/expanders/square_sum_all.py +0 -44
- mindspore/_extends/graph_kernel/expanders/square_sum_v1.py +0 -37
- mindspore/_extends/graph_kernel/expanders/squared_difference.py +0 -43
- mindspore/_extends/graph_kernel/expanders/tanh_grad.py +0 -31
- mindspore/_extends/graph_kernel/model/op_infer.py +0 -506
- mindspore/dataset/datapreprocess/__init__.py +0 -20
- mindspore/dataset/datapreprocess/preprocess_imagenet_validate_dataset.py +0 -54
- mindspore/include/api/net.h +0 -142
- mindspore/nn/lr_scheduler.py +0 -262
- mindspore/ops/_grad_experimental/grad_image_ops.py +0 -248
- mindspore/ops/_grad_experimental/grad_linalg_ops.py +0 -181
- mindspore/ops/_grad_experimental/grad_other_ops.py +0 -72
- mindspore/ops/_grad_experimental/grad_scalar_ops.py +0 -112
- mindspore/ops/_grad_experimental/grad_sequence_ops.py +0 -351
- mindspore/ops/bprop_mindir/BNTrainingReduce_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Broadcast_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Depend_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/DepthwiseConv2dNative_bprop.mindir +0 -138
- mindspore/ops/bprop_mindir/EmbeddingLookup_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Load_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/ScatterNonAliasingAdd_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/SparseGatherV2_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/SparseSoftmaxCrossEntropyWithLogits_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Switch_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/TransShape_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/TupleGetItem_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Unique_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/Unstack_bprop.mindir +0 -0
- mindspore/ops/bprop_mindir/generate_mindir.py +0 -114
- mindspore/rewrite/node_visitor.py +0 -44
- {mindspore-2.1.0.dist-info → mindspore-2.2.0.dist-info}/WHEEL +0 -0
- {mindspore-2.1.0.dist-info → mindspore-2.2.0.dist-info}/top_level.txt +0 -0
mindspore/_checkparam.py
CHANGED
|
@@ -84,21 +84,21 @@ def _check_inc_rel(val, lower, upper, rel):
|
|
|
84
84
|
def _format_str_one_value(value, rel):
|
|
85
85
|
"""format string"""
|
|
86
86
|
if rel == EQ:
|
|
87
|
-
return "= {}"
|
|
87
|
+
return f"= {value}"
|
|
88
88
|
if rel == NE:
|
|
89
|
-
return "!= {}"
|
|
89
|
+
return f"!= {value}"
|
|
90
90
|
if rel == LT:
|
|
91
|
-
return "< {}"
|
|
91
|
+
return f"< {value}"
|
|
92
92
|
if rel == LE:
|
|
93
|
-
return "<= {}"
|
|
93
|
+
return f"<= {value}"
|
|
94
94
|
if rel == GT:
|
|
95
|
-
return "> {}"
|
|
95
|
+
return f"> {value}"
|
|
96
96
|
if rel == GE:
|
|
97
|
-
return ">= {}"
|
|
97
|
+
return f">= {value}"
|
|
98
98
|
if rel == IN:
|
|
99
|
-
return "in {}"
|
|
99
|
+
return f"in {value}"
|
|
100
100
|
if rel == NOT_IN:
|
|
101
|
-
return "not in {}"
|
|
101
|
+
return f"not in {value}"
|
|
102
102
|
|
|
103
103
|
return ""
|
|
104
104
|
|
|
@@ -106,13 +106,13 @@ def _format_str_one_value(value, rel):
|
|
|
106
106
|
def _format_str_two_value(val1, val2, rel):
|
|
107
107
|
"""format string"""
|
|
108
108
|
if rel == INC_NEITHER:
|
|
109
|
-
return "({}, {})"
|
|
109
|
+
return f"({val1}, {val2})"
|
|
110
110
|
if rel == INC_LEFT:
|
|
111
|
-
return "[{}, {})"
|
|
111
|
+
return f"[{val1}, {val2})"
|
|
112
112
|
if rel == INC_RIGHT:
|
|
113
|
-
return "({}, {}]"
|
|
113
|
+
return f"({val1}, {val2}]"
|
|
114
114
|
if rel == INC_BOTH:
|
|
115
|
-
return "[{}, {}]"
|
|
115
|
+
return f"[{val1}, {val2}]"
|
|
116
116
|
|
|
117
117
|
return ""
|
|
118
118
|
|
|
@@ -556,8 +556,7 @@ def check_str_by_regular(target, reg=None, flag=re.ASCII, prim_name=None):
|
|
|
556
556
|
reg = r"^\w+[0-9a-zA-Z\_\.]*$"
|
|
557
557
|
if re.match(reg, target, flag) is None:
|
|
558
558
|
prim_name = f"For '{prim_name}', the" if prim_name else "The"
|
|
559
|
-
raise ValueError("{} '{}' is illegal, it must be match regular'{}' by flags'{}.'"
|
|
560
|
-
prim_name, target, reg, flag))
|
|
559
|
+
raise ValueError(f"{prim_name} '{target}' is illegal, it must be match regular'{reg}' by flags'{flag}.'")
|
|
561
560
|
return True
|
|
562
561
|
|
|
563
562
|
|
|
@@ -565,11 +564,10 @@ def check_str_by_regular(target, reg=None, flag=re.ASCII, prim_name=None):
|
|
|
565
564
|
def check_str_and_none_by_regular(target, reg=None, flag=re.ASCII, prim_name=None):
|
|
566
565
|
if reg is None:
|
|
567
566
|
# Named string regular expression
|
|
568
|
-
reg = r"^\w*[0-9a-zA-Z\_
|
|
567
|
+
reg = r"^\w*[0-9a-zA-Z\_\.\-]*$"
|
|
569
568
|
if re.match(reg, target, flag) is None:
|
|
570
569
|
prim_name = f"For '{prim_name}', the" if prim_name else "The"
|
|
571
|
-
raise ValueError("{} '{}' is illegal, it must be match regular'{}' by flags'{}.'"
|
|
572
|
-
prim_name, target, reg, flag))
|
|
570
|
+
raise ValueError(f"{prim_name} '{target}' is illegal, it must be match regular'{reg}' by flags'{flag}.'")
|
|
573
571
|
return True
|
|
574
572
|
|
|
575
573
|
|
|
@@ -585,8 +583,7 @@ def check_file_name_by_regular(target, reg=None, prim_name=None):
|
|
|
585
583
|
reg = r"^[0-9a-zA-Z@\_\-\.\:\/\\]+$"
|
|
586
584
|
if re.match(reg, target) is None:
|
|
587
585
|
prim_name = f"For '{prim_name}', the" if prim_name else "The"
|
|
588
|
-
raise ValueError("{} '{}' is illegal, it must be match regular '{}'."
|
|
589
|
-
prim_name, target, reg))
|
|
586
|
+
raise ValueError(f"{prim_name} '{target}' is illegal, it must be match regular '{reg}'.")
|
|
590
587
|
|
|
591
588
|
return True
|
|
592
589
|
|
|
@@ -723,9 +720,9 @@ def check_value_type(arg_name, arg_value, valid_types, prim_name=None):
|
|
|
723
720
|
type_names = [t.__name__ if hasattr(t, '__name__') else str(t) for t in valid_types]
|
|
724
721
|
num_types = len(valid_types)
|
|
725
722
|
msg_prefix = f"For '{prim_name}', the" if prim_name else "The"
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
723
|
+
type_name_msg = f'{type_names if num_types > 1 else type_names[0]}'
|
|
724
|
+
msg = f'type of \'{arg_name}\' should be{"one of " if num_types > 1 else ""} \'{type_name_msg}\''
|
|
725
|
+
raise TypeError(f'{msg_prefix} {msg}, but got type \'{type(arg_value).__name__}\'.')
|
|
729
726
|
|
|
730
727
|
# Notice: bool is subclass of int, so `check_value_type('x', True, [int])` will check fail, and
|
|
731
728
|
# `check_value_type('x', True, [bool, int])` will check pass
|
|
@@ -802,6 +799,9 @@ def check_transpose_axis(axes, ndim):
|
|
|
802
799
|
# if only one argument provided, it must be tuple or list
|
|
803
800
|
if isinstance(perm, list):
|
|
804
801
|
perm = tuple(perm)
|
|
802
|
+
elif isinstance(perm, int):
|
|
803
|
+
perm = (perm,)
|
|
804
|
+
_check_dim()
|
|
805
805
|
else:
|
|
806
806
|
if not isinstance(perm, tuple):
|
|
807
807
|
raise TypeError(f"For Tensor.transpose, the parameter 'axes' must be a tuple/list, " \
|
|
@@ -959,11 +959,6 @@ def is_stub_tensor(tensor):
|
|
|
959
959
|
return hasattr(tensor, "stub")
|
|
960
960
|
|
|
961
961
|
|
|
962
|
-
def is_pack_tensor(tensor):
|
|
963
|
-
"""Whether it is a PackTensor."""
|
|
964
|
-
return hasattr(tensor, "__pack__")
|
|
965
|
-
|
|
966
|
-
|
|
967
962
|
def expanded_shape(ndim, axis_size, axis):
|
|
968
963
|
"""
|
|
969
964
|
Returns a shape with size = 1 for all dimensions
|
|
@@ -984,8 +979,8 @@ def infer_out_shape(*shapes):
|
|
|
984
979
|
def _check(items, max_size, shapes):
|
|
985
980
|
for item in items:
|
|
986
981
|
if item not in (1, max_size):
|
|
987
|
-
raise ValueError(f'For Tensor, the dimension on each axis must be 1 or the max on the axis' \
|
|
988
|
-
f'to support
|
|
982
|
+
raise ValueError(f'For Tensor, the dimension on each axis must be 1 or the max value on the axis' \
|
|
983
|
+
f'to support broadcasting, but got shapes {shapes,}')
|
|
989
984
|
shape_out = ()
|
|
990
985
|
max_len = max([len(it) for it in shapes])
|
|
991
986
|
for i in range(max_len):
|
|
@@ -1269,7 +1264,7 @@ def check_input_data(*data, data_class):
|
|
|
1269
1264
|
if not ret:
|
|
1270
1265
|
data_class_str = tuple(i.__name__ if hasattr(i, '__name__') else i for i in data_class) if isinstance(
|
|
1271
1266
|
data_class, (tuple, list)) else (data_class if data_class is None else data_class.__name__)
|
|
1272
|
-
raise TypeError(f'The
|
|
1267
|
+
raise TypeError(f'The types of input data must be in the Union({data_class_str}, ' \
|
|
1273
1268
|
f'tuple[{data_class_str}], list[{data_class_str}], dict[{data_class_str}]), ' \
|
|
1274
1269
|
f'but got type {item if item is None else type(item).__name__}.')
|
|
1275
1270
|
|
|
@@ -1314,8 +1309,7 @@ def args_type_check(*type_args, **type_kwargs):
|
|
|
1314
1309
|
for name, value in argument_dict.items():
|
|
1315
1310
|
if name in bound_types:
|
|
1316
1311
|
if value is not None and not isinstance(value, bound_types[name]):
|
|
1317
|
-
raise TypeError("The parameter '{}' must be {}, but got {}"
|
|
1318
|
-
.format(name, bound_types[name], type(value)))
|
|
1312
|
+
raise TypeError(f"The parameter '{name}' must be {bound_types[name]}, but got {type(value)}")
|
|
1319
1313
|
return func(*args, **kwargs)
|
|
1320
1314
|
|
|
1321
1315
|
return wrapper
|
|
@@ -14,5 +14,4 @@
|
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""init"""
|
|
16
16
|
from .splitter import split_with_json
|
|
17
|
-
from .expander import get_op_expander, get_expander_op_list
|
|
18
17
|
from .parallel_estimate import estimate_calculation_amount, estimate_ops
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ===========================================================================
|
|
15
15
|
"""GraphKernel model builder"""
|
|
16
|
-
|
|
17
|
-
import copy
|
|
18
|
-
from . import op_infer
|
|
19
16
|
from .model import Tensor, Value, Operator, Graph, AlignShape
|
|
20
17
|
|
|
21
18
|
|
|
@@ -95,18 +92,6 @@ class GraphBuilder:
|
|
|
95
92
|
node.all_inputs = inputs
|
|
96
93
|
self.current.graph.add(node)
|
|
97
94
|
|
|
98
|
-
def emit(self, prim, inputs, name=None, attrs=None):
|
|
99
|
-
"""Emit a new operation"""
|
|
100
|
-
if attrs is None:
|
|
101
|
-
attrs = {}
|
|
102
|
-
if isinstance(inputs, (Tensor, Value)):
|
|
103
|
-
inputs = [inputs]
|
|
104
|
-
tensor_inputs = [t for t in inputs if isinstance(t, (Tensor, Value))]
|
|
105
|
-
out_shape, out_dtype, out_format = op_infer.infer(prim, tensor_inputs, attrs)
|
|
106
|
-
output = self.tensor(out_shape, out_dtype, out_format, name)
|
|
107
|
-
self.op(prim, output, inputs, attrs)
|
|
108
|
-
return output
|
|
109
|
-
|
|
110
95
|
def get(self):
|
|
111
96
|
"""Get graphs"""
|
|
112
97
|
return self.graphs
|
|
@@ -169,15 +154,18 @@ class CompositeGraph:
|
|
|
169
154
|
for op in desc['op_desc']:
|
|
170
155
|
inputs = [self.tensors.get(d['tensor_name'], None) for x in op['input_desc']
|
|
171
156
|
for d in x if 'value' not in d]
|
|
157
|
+
if op['name'] in ('ReduceSum', 'ReduceMax', 'ReduceMin'):
|
|
158
|
+
axis = op['input_desc'][1][0]['value']
|
|
159
|
+
if isinstance(axis, int):
|
|
160
|
+
axis = [axis]
|
|
161
|
+
if not op['attr']:
|
|
162
|
+
attr = [{'name': 'axis', 'dtype': 'listInt', 'value': axis}]
|
|
163
|
+
op['attr'] = attr
|
|
164
|
+
else:
|
|
165
|
+
op['attr'].append({'name': 'axis', 'dtype': 'listInt', 'value': axis})
|
|
172
166
|
out_desc = op['output_desc']
|
|
173
167
|
name, shape, dtype, data_format = out_desc[0]['tensor_name'], out_desc[
|
|
174
168
|
0]['shape'], out_desc[0]['data_type'], out_desc[0]['format']
|
|
175
|
-
if op['name'] == 'InplaceAssign':
|
|
176
|
-
inputs[0].add_buddy(inputs[1])
|
|
177
|
-
inputs[1].para_type = Tensor.PARA_OUTPUT
|
|
178
|
-
output = inputs[2]
|
|
179
|
-
self.tensors[name] = output
|
|
180
|
-
continue
|
|
181
169
|
output = self.tensors.get(name, None)
|
|
182
170
|
if not output:
|
|
183
171
|
output = builder.tensor(shape, dtype, data_format, name=name)
|
|
@@ -186,46 +174,17 @@ class CompositeGraph:
|
|
|
186
174
|
self.graph = builder.get()[0]
|
|
187
175
|
self.desc = desc
|
|
188
176
|
|
|
189
|
-
def _pre_dump(self, outputs):
|
|
190
|
-
"""restore name to before load"""
|
|
191
|
-
inplace_assign = {} # y_name, output_name
|
|
192
|
-
inplace_assign_z = None
|
|
193
|
-
for op in self.desc['op_desc']:
|
|
194
|
-
if op['name'] == 'InplaceAssign':
|
|
195
|
-
inplace_assign[op['input_desc'][1][0]['tensor_name']] = op['output_desc'][0]['tensor_name']
|
|
196
|
-
if inplace_assign:
|
|
197
|
-
for t in outputs:
|
|
198
|
-
if t.name not in inplace_assign:
|
|
199
|
-
inplace_assign_z = t
|
|
200
|
-
return inplace_assign, inplace_assign_z
|
|
201
177
|
|
|
202
178
|
def dump(self, subgraph):
|
|
203
179
|
"""Dump Graph to json"""
|
|
204
180
|
desc = {}
|
|
205
181
|
inputs, outputs = subgraph.deduce_parameters()
|
|
206
182
|
graph_ops = set(subgraph.ops)
|
|
207
|
-
inplace_assign, inplace_assign_z = self._pre_dump(outputs)
|
|
208
183
|
|
|
209
184
|
def dump_output(t):
|
|
210
|
-
if t.name in inplace_assign:
|
|
211
|
-
z = inplace_assign_z if inplace_assign_z is not None else self.tensors.get(t.name, None)
|
|
212
|
-
return {'data_type': z.dtype, 'shape': z.shape, 'tensor_name': inplace_assign.get(t.name)}
|
|
213
185
|
return {'data_type': t.dtype, 'shape': t.shape, 'tensor_name': t.name}
|
|
214
186
|
|
|
215
187
|
def dump_op_desc(d):
|
|
216
|
-
if d['name'] == 'InplaceAssign':
|
|
217
|
-
y = d['input_desc'][1][0]['tensor_name']
|
|
218
|
-
if self.tensors[y].op in graph_ops:
|
|
219
|
-
z, fake = (inplace_assign_z, False) if inplace_assign_z is not None else (self.tensors.get(y), True)
|
|
220
|
-
inplace_desc = copy.deepcopy(d)
|
|
221
|
-
inplace_desc['attr'] = {'name': 'fake_output', 'value': fake}
|
|
222
|
-
z_desc, out_desc = inplace_desc['input_desc'][2][0], inplace_desc['output_desc'][0]
|
|
223
|
-
z_desc['shape'] = z.shape
|
|
224
|
-
z_desc['data_type'] = z.dtype
|
|
225
|
-
z_desc['tensor_name'] = z.name
|
|
226
|
-
out_desc['shape'] = z.shape
|
|
227
|
-
out_desc['data_type'] = z.dtype
|
|
228
|
-
return inplace_desc
|
|
229
188
|
op = self.tensors[d['output_desc'][0]['tensor_name']].op
|
|
230
189
|
if op in graph_ops or op in subgraph.recompute_ops:
|
|
231
190
|
return d
|
|
@@ -36,7 +36,6 @@ def split_with_json(json_str, flags_str):
|
|
|
36
36
|
subgraphs, graph_mode = model.split(comp.graph, target, flags)
|
|
37
37
|
is_multi_graph = len(subgraphs) > 1
|
|
38
38
|
graph_list = list(map(comp.dump, subgraphs))
|
|
39
|
-
_reset_graphmode_for_inplaceassign(graph_list, graph_mode)
|
|
40
39
|
result = {"multi_graph": is_multi_graph,
|
|
41
40
|
"graph_desc": graph_list,
|
|
42
41
|
"graph_mode": graph_mode}
|
|
@@ -114,19 +113,12 @@ def _load_repository(graph, flags):
|
|
|
114
113
|
return result
|
|
115
114
|
|
|
116
115
|
|
|
117
|
-
def _reset_graphmode_for_inplaceassign(graph_list, graph_mode):
|
|
118
|
-
"""Operator with InplaceAssign should always be composite op"""
|
|
119
|
-
for i, g in enumerate(graph_list):
|
|
120
|
-
if any((op['name'] == 'InplaceAssign' for op in g['op_desc'])):
|
|
121
|
-
graph_mode[i] = 'composite'
|
|
122
|
-
|
|
123
|
-
|
|
124
116
|
def _dump_split_info(use_repo, graph_str, graph, subgraphs, graph_mode, graph_list):
|
|
125
117
|
"""Dump split info as text"""
|
|
126
118
|
graph_kernel_dump_path = "graph_kernel_dump"
|
|
127
119
|
utils.create_dir(graph_kernel_dump_path)
|
|
128
120
|
filename = os.path.join(graph_kernel_dump_path, "graph_kernel_split_mode.%d.txt" % os.getpid())
|
|
129
|
-
with os.fdopen(os.open(filename, os.O_WRONLY | os.O_CREAT), "a+") as f:
|
|
121
|
+
with os.fdopen(os.open(filename, os.O_WRONLY | os.O_CREAT, 0o600), "a+") as f:
|
|
130
122
|
f.write("********** main graph: {} **********\n".format(graph.name))
|
|
131
123
|
f.write("input json:\n{}\n".format(graph_str))
|
|
132
124
|
f.write("graph desc:\n{}\n".format(str(graph)))
|
|
@@ -113,30 +113,115 @@ def create_akg_parallel_process(process_num, wait_time, platform):
|
|
|
113
113
|
return AkgProcess(process_num, wait_time, platform)
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
def _is_input_shape_dynamic(desc_d):
|
|
117
|
+
input_lists = desc_d.get("input_desc", [])
|
|
118
|
+
if input_lists is None:
|
|
119
|
+
return True
|
|
120
|
+
for input_desc in input_lists:
|
|
121
|
+
shape = input_desc[0].get("shape", ())
|
|
122
|
+
if -1 in shape or -2 in shape:
|
|
123
|
+
return True
|
|
124
|
+
return False
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
|
|
127
|
+
def _compile_akg_v2_task_default(json_strs, attrs, driver):
|
|
128
|
+
"""
|
|
129
|
+
compile func called in single process
|
|
130
|
+
|
|
131
|
+
Parameters:
|
|
132
|
+
json_strs: list. List contains multiple kernel infos, suitable for json compile api.
|
|
133
|
+
"""
|
|
134
|
+
log_level = get_log_level(attrs)
|
|
135
|
+
kernel_meta_dir = os.path.join(get_kernel_meta_parent_dir(attrs), "akg_kernel_meta")
|
|
136
|
+
for json_str in json_strs:
|
|
137
|
+
json_desc = json.loads(json_str)
|
|
138
|
+
op_name = json_desc["op"]
|
|
139
|
+
info_path = os.path.join(kernel_meta_dir, op_name + ".info")
|
|
140
|
+
if not os.path.isfile(info_path):
|
|
141
|
+
raise FileNotFoundError(f"Can not compile non-existing file \"{info_path}\"")
|
|
142
|
+
# Compile json str with AKG
|
|
143
|
+
bisheng_cpp_path = os.getenv("BISHENG_CPP_PATH", default="")
|
|
144
|
+
compiler = driver(input_file=info_path, output_dir=kernel_meta_dir, bisheng_tools_dir=bisheng_cpp_path,
|
|
145
|
+
dynamic_shape=_is_input_shape_dynamic(json_desc))
|
|
146
|
+
try:
|
|
147
|
+
compiler.compile()
|
|
148
|
+
except RuntimeError as exc:
|
|
149
|
+
if log_level == "ERROR":
|
|
150
|
+
raise ValueError(f"Compile error, json str: {json_str}! build attrs: {attrs}") from exc
|
|
151
|
+
logger.info(f"Will try to split, json str: {json_str}! build attrs: {attrs}")
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def create_akg_v2_parallel_process(process_num, wait_time, platform):
|
|
155
|
+
"""
|
|
156
|
+
create Akg V2 Parallel Compiler object
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
AKG V2 ParallelCompiler
|
|
160
|
+
"""
|
|
161
|
+
return AkgV2Process(process_num, wait_time, platform)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class AkgProcessBase:
|
|
165
|
+
"""base class for akg kernel parallel process"""
|
|
166
|
+
|
|
167
|
+
def __init__(self, name, process_num, wait_time, platform):
|
|
120
168
|
"""
|
|
121
169
|
Args:
|
|
122
170
|
process_num: int. processes number
|
|
123
171
|
wait_time: int. max time the function blocked
|
|
124
172
|
"""
|
|
125
173
|
if not isinstance(process_num, int):
|
|
126
|
-
raise ValueError(
|
|
127
|
-
|
|
174
|
+
raise ValueError(
|
|
175
|
+
f"{name} kernel compiling process number must be of type int"
|
|
176
|
+
", but got {process_num} with type {type(wait_time)}")
|
|
128
177
|
if not isinstance(wait_time, int):
|
|
129
|
-
raise ValueError(
|
|
130
|
-
|
|
178
|
+
raise ValueError(
|
|
179
|
+
f"{name} kernel compiling wait time must be of type int,"
|
|
180
|
+
" but got {wait_time} with type {type(wait_time)}")
|
|
131
181
|
if process_num == 0:
|
|
132
182
|
process_num = 1
|
|
133
183
|
max_proc_num = 16
|
|
184
|
+
self.name = name
|
|
134
185
|
self.process_num = min([cpu_count(), max_proc_num, process_num])
|
|
135
186
|
self.args = list([] for _ in range(self.process_num))
|
|
136
187
|
self.wait_time = wait_time
|
|
137
188
|
self.platform = platform
|
|
138
189
|
self.argc = 0
|
|
139
190
|
|
|
191
|
+
def compile(self, attrs=None):
|
|
192
|
+
"""
|
|
193
|
+
compile kernel by multi processes
|
|
194
|
+
Return:
|
|
195
|
+
True for all compile success, False for some failed.
|
|
196
|
+
"""
|
|
197
|
+
del attrs
|
|
198
|
+
raise NotImplementedError
|
|
199
|
+
|
|
200
|
+
def accept_json(self, json_str):
|
|
201
|
+
"""
|
|
202
|
+
accept json data before compile
|
|
203
|
+
Args:
|
|
204
|
+
json_str: str. kernel info.
|
|
205
|
+
"""
|
|
206
|
+
if not isinstance(json_str, str):
|
|
207
|
+
raise ValueError(
|
|
208
|
+
f"In {self.name} kernel compiling, the kernel json must be of type str"
|
|
209
|
+
", but got {json_str} with type { type(json_str)}")
|
|
210
|
+
self.args[self.argc % self.process_num].append(json_str)
|
|
211
|
+
self.argc += 1
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class AkgProcess(AkgProcessBase):
|
|
215
|
+
"""akg kernel parallel process"""
|
|
216
|
+
|
|
217
|
+
def __init__(self, process_num, wait_time, platform):
|
|
218
|
+
"""
|
|
219
|
+
Args:
|
|
220
|
+
process_num: int. processes number
|
|
221
|
+
wait_time: int. max time the function blocked
|
|
222
|
+
"""
|
|
223
|
+
super(AkgProcess, self).__init__("AKG", process_num, wait_time, platform)
|
|
224
|
+
|
|
140
225
|
def compile(self, attrs=None):
|
|
141
226
|
"""
|
|
142
227
|
compile kernel by multi processes
|
|
@@ -162,14 +247,36 @@ class AkgProcess:
|
|
|
162
247
|
res.get(timeout=self.wait_time)
|
|
163
248
|
return True
|
|
164
249
|
|
|
165
|
-
|
|
250
|
+
|
|
251
|
+
class AkgV2Process(AkgProcessBase):
|
|
252
|
+
"""akg v2 kernel parallel process"""
|
|
253
|
+
|
|
254
|
+
def __init__(self, process_num, wait_time, platform):
|
|
166
255
|
"""
|
|
167
|
-
accept json data before compile
|
|
168
256
|
Args:
|
|
169
|
-
|
|
257
|
+
process_num: int. processes number
|
|
258
|
+
wait_time: int. max time the function blocked
|
|
170
259
|
"""
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
260
|
+
super(AkgV2Process, self).__init__("AKG V2", process_num, wait_time, platform)
|
|
261
|
+
|
|
262
|
+
def compile(self, attrs=None):
|
|
263
|
+
"""
|
|
264
|
+
compile kernel by multi processes
|
|
265
|
+
Return:
|
|
266
|
+
True for all compile success, False for some failed.
|
|
267
|
+
"""
|
|
268
|
+
if self.argc == 0:
|
|
269
|
+
raise ValueError("In AKG V2 kernel compiling, the number of kernel json that need to be compiled can "
|
|
270
|
+
"not be zero.")
|
|
271
|
+
akg_v2_path = os.getenv("AKG_V2_PATH", default="")
|
|
272
|
+
if akg_v2_path == "":
|
|
273
|
+
raise ValueError(
|
|
274
|
+
"The path to akg v2 compiler is not specified. Set the path to the compiler in AKG_V2_PATH")
|
|
275
|
+
sys.path.append(akg_v2_path)
|
|
276
|
+
p = __import__("akg_v2", globals(), locals())
|
|
277
|
+
driver = getattr(p, "AkgV2Driver")
|
|
278
|
+
args = list((arg, attrs, driver) for arg in self.args)
|
|
279
|
+
with Pool(processes=self.process_num) as pool:
|
|
280
|
+
res = pool.starmap_async(_compile_akg_v2_task_default, args)
|
|
281
|
+
res.get(timeout=self.wait_time)
|
|
282
|
+
return True
|
|
@@ -98,7 +98,7 @@ class TransShape:
|
|
|
98
98
|
formats.append(v["format"])
|
|
99
99
|
ori_formats.append(v["ori_format"])
|
|
100
100
|
if len(shapes) == 2 and len(shapes[0]) != len(shapes[1]):
|
|
101
|
-
from impl.add import _add_check_format, _infer_shape
|
|
101
|
+
from impl.dynamic.add import _add_check_format, _infer_shape
|
|
102
102
|
format_pattern = _add_check_format({"shape": shapes[0], "format": formats[0]},
|
|
103
103
|
{"shape": shapes[1], "format": formats[1]})
|
|
104
104
|
ori_shape0 = ori_shapes[0] if ori_shapes[0] is not None else infer_ori_shape(
|
|
@@ -410,7 +410,7 @@ def update_json(json_dict, inputs_name, outputs_name, inplace_names, kernel_meta
|
|
|
410
410
|
pass
|
|
411
411
|
# generate new .json
|
|
412
412
|
try:
|
|
413
|
-
with os.fdopen(os.open(json_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
|
|
413
|
+
with os.fdopen(os.open(json_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w') as fi:
|
|
414
414
|
json.dump(json_dict, fi, sort_keys=True, indent=4, separators=(',', ':'))
|
|
415
415
|
except OSError:
|
|
416
416
|
pass
|
|
@@ -310,7 +310,8 @@ def _log(x, attrs=None):
|
|
|
310
310
|
if base <= 0 and not math.isclose(base, -1.0, rel_tol=1e-8, abs_tol=0.0):
|
|
311
311
|
raise ValueError("base must be strictly positive or -1, but got {}".format(base))
|
|
312
312
|
from impl.log import log_compute
|
|
313
|
-
|
|
313
|
+
outputDesc = {"dtype": x.dtype, "shape": x.shape}
|
|
314
|
+
return log_compute(x, outputDesc, base, scale, shift, kernel_name=attrs["fusion_op_name"])
|
|
314
315
|
|
|
315
316
|
|
|
316
317
|
@reg_op("Maximum", pattern=OpPattern.ELEMWISE)
|
|
@@ -349,7 +350,8 @@ def _mul(x0, x1, attrs=None):
|
|
|
349
350
|
return tbe.dsl.vmuls(x1, x0)
|
|
350
351
|
x0, x1 = _broadcast(x0, x1)
|
|
351
352
|
from impl.mul import mul_compute
|
|
352
|
-
|
|
353
|
+
outputDesc = {"dtype": x0.dtype, "shape": x0.shape}
|
|
354
|
+
return mul_compute(x0, x1, outputDesc, kernel_name=attrs["fusion_op_name"])
|
|
353
355
|
|
|
354
356
|
|
|
355
357
|
@reg_op("Neg", pattern=OpPattern.ELEMWISE)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2023 Huawei Technologies Co., Ltd
|
|
1
|
+
# Copyright 2021-2023 Huawei Technologies Co., Ltd
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -116,7 +116,7 @@ def __directory_creation(path, concat_path):
|
|
|
116
116
|
"""
|
|
117
117
|
path = os.path.join(path, concat_path)
|
|
118
118
|
if not os.path.isdir(path):
|
|
119
|
-
os.makedirs(path,
|
|
119
|
+
os.makedirs(path, 0o700)
|
|
120
120
|
return path
|
|
121
121
|
|
|
122
122
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2021 Huawei Technologies Co., Ltd
|
|
1
|
+
# Copyright 2021-2023 Huawei Technologies Co., Ltd
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -32,7 +32,7 @@ def create_dir(dir_path):
|
|
|
32
32
|
is_exists = os.path.exists(dir_path)
|
|
33
33
|
if not is_exists:
|
|
34
34
|
try:
|
|
35
|
-
os.makedirs(dir_path,
|
|
35
|
+
os.makedirs(dir_path, 0o700, exist_ok=True)
|
|
36
36
|
except (OSError, TypeError) as excep:
|
|
37
37
|
raise excep
|
|
38
38
|
finally:
|
|
@@ -53,7 +53,7 @@ def write_to_file(file_path, content=""):
|
|
|
53
53
|
return False
|
|
54
54
|
|
|
55
55
|
with os.fdopen(os.open(file_path, os.O_WRONLY | os.O_CREAT, \
|
|
56
|
-
stat.S_IWUSR | stat.S_IRUSR
|
|
56
|
+
stat.S_IWUSR | stat.S_IRUSR), 'w') as file_handler:
|
|
57
57
|
file_handler.write(content)
|
|
58
58
|
return True
|
|
59
59
|
|
|
@@ -66,7 +66,7 @@ class LocalLock:
|
|
|
66
66
|
def __init__(self, lock_file):
|
|
67
67
|
if not os.path.exists(lock_file):
|
|
68
68
|
write_to_file(lock_file)
|
|
69
|
-
self.lock_fd = os.open(lock_file, os.O_WRONLY | os.O_CREAT, stat.S_IWUSR | stat.S_IRUSR
|
|
69
|
+
self.lock_fd = os.open(lock_file, os.O_WRONLY | os.O_CREAT, stat.S_IWUSR | stat.S_IRUSR)
|
|
70
70
|
|
|
71
71
|
def __del__(self):
|
|
72
72
|
try:
|
|
@@ -23,13 +23,12 @@ from .parser import (Parser, create_instance, is_supported_create_instance_type,
|
|
|
23
23
|
get_ast_type, get_node_type, get_args, get_args_default_values, get_ast_namespace_symbol,
|
|
24
24
|
get_operation_symbol, get_operation_namespace_symbol, get_parse_method_of_class, get_scope_name,
|
|
25
25
|
eval_script, get_script_id_attrs, expand_expr_statement, is_class_member_of_self, parse_cb,
|
|
26
|
-
convert_to_ms_tensor, get_object_description,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
get_const_len, is_adapter_tensor_class, is_adapter_parameter_class)
|
|
26
|
+
convert_to_ms_tensor, get_object_description, get_ms_class_name, is_class_type, check_obj_bool,
|
|
27
|
+
python_isinstance, ms_isinstance, convert_to_ms_csrtensor, convert_to_ms_cootensor,
|
|
28
|
+
convert_class_to_function, convert_cell_list_to_sequence, is_cell_list, get_obj_from_sequence,
|
|
29
|
+
get_type, is_class_member_recursive, get_global_params, get_adapter_tensor_attr,
|
|
30
|
+
get_obj_defined_from_obj_type, is_from_third_party_library, get_const_abs, get_const_round,
|
|
31
|
+
get_const_len, is_adapter_tensor_class, is_adapter_parameter_class, convert_to_namedtuple)
|
|
33
32
|
|
|
34
33
|
__all__ = ['Parser', 'create_instance', 'is_supported_create_instance_type', 'generate_scope', 'get_attr_from_object',
|
|
35
34
|
'get_bprop_method_of_class', 'get_class_instance_type', 'get_class_member_namespace_symbol',
|
|
@@ -37,11 +36,9 @@ __all__ = ['Parser', 'create_instance', 'is_supported_create_instance_type', 'ge
|
|
|
37
36
|
'get_ast_type', 'get_node_type', 'get_args', 'get_args_default_values', 'get_ast_namespace_symbol',
|
|
38
37
|
'get_operation_symbol', 'get_operation_namespace_symbol', 'get_parse_method_of_class', 'get_scope_name',
|
|
39
38
|
'eval_script', 'get_script_id_attrs', 'expand_expr_statement', 'is_class_member_of_self', 'parse_cb',
|
|
40
|
-
'resolve_symbol', 'convert_to_ms_tensor', 'get_object_description', '
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'get_const_abs', 'get_const_round', 'get_const_len', 'is_adapter_tensor_class',
|
|
47
|
-
'is_adapter_parameter_class',]
|
|
39
|
+
'resolve_symbol', 'convert_to_ms_tensor', 'get_object_description', 'get_ms_class_name', 'is_class_type',
|
|
40
|
+
'check_obj_bool', 'python_isinstance', 'ms_isinstance', 'convert_to_ms_csrtensor', 'convert_to_ms_cootensor',
|
|
41
|
+
'convert_class_to_function', 'convert_cell_list_to_sequence', 'is_cell_list', 'get_obj_from_sequence',
|
|
42
|
+
'get_type', 'is_class_member_recursive', 'get_adapter_tensor_attr', 'get_obj_defined_from_obj_type',
|
|
43
|
+
'is_from_third_party_library', 'get_const_abs', 'get_const_round', 'get_const_len',
|
|
44
|
+
'is_adapter_tensor_class', 'is_adapter_parameter_class', 'convert_to_namedtuple',]
|