mindspore 2.3.0__cp39-cp39-win_amd64.whl → 2.4.1__cp39-cp39-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.cp39-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp39-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp39-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/avcodec-59.dll +0 -0
- mindspore/avdevice-59.dll +0 -0
- mindspore/avfilter-8.dll +0 -0
- mindspore/avformat-59.dll +0 -0
- mindspore/avutil-57.dll +0 -0
- mindspore/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/dnnl.dll +0 -0
- 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/jpeg62.dll +0 -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_glog.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/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- 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/turbojpeg.dll +0 -0
- 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 +260 -254
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/WHEEL +1 -1
- 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}/entry_points.txt +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.4.1.dist-info}/top_level.txt +0 -0
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#ifndef MINDSPORE_CCSRC_C_API_INCLUDE_NODE_H_
|
|
18
|
-
#define MINDSPORE_CCSRC_C_API_INCLUDE_NODE_H_
|
|
19
|
-
|
|
20
|
-
#include <stdbool.h>
|
|
21
|
-
#include <stdlib.h>
|
|
22
|
-
#include "include/c_api/ms/context.h"
|
|
23
|
-
#include "include/c_api/ms/base/macros.h"
|
|
24
|
-
#include "include/c_api/ms/base/status.h"
|
|
25
|
-
#include "include/c_api/ms/base/handle_types.h"
|
|
26
|
-
#include "include/c_api/ms/base/types.h"
|
|
27
|
-
|
|
28
|
-
#ifdef __cplusplus
|
|
29
|
-
extern "C" {
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
/// \brief The struct to describe custom op's basic info. For output_dtypes and dtype_infer_func, only one of them need
|
|
33
|
-
/// to be specified. For output_shapes and shape_infer_func, only one of them need to be specified as well, and
|
|
34
|
-
/// output_dims must be given if output_shapes is specified.
|
|
35
|
-
typedef struct CustomOpInfo {
|
|
36
|
-
const char *func_name;
|
|
37
|
-
const char *func_type;
|
|
38
|
-
const char *target;
|
|
39
|
-
const char **input_names;
|
|
40
|
-
size_t input_num;
|
|
41
|
-
const char **output_names;
|
|
42
|
-
size_t output_num;
|
|
43
|
-
const char **attr_names;
|
|
44
|
-
ValueHandle *attr_values;
|
|
45
|
-
size_t attr_num;
|
|
46
|
-
DTypeFormat **dtype_formats;
|
|
47
|
-
size_t dtype_formats_num;
|
|
48
|
-
int64_t **output_shapes;
|
|
49
|
-
size_t *output_dims;
|
|
50
|
-
DataTypeC *output_dtypes;
|
|
51
|
-
STATUS(*dtype_infer_func)
|
|
52
|
-
(const DataTypeC *input_types, size_t input_num, DataTypeC *output_types, size_t output_num);
|
|
53
|
-
STATUS(*shape_infer_func)
|
|
54
|
-
(int64_t **input_shapes, const size_t *input_dims, size_t input_num, int64_t **output_shapes, size_t *output_dims,
|
|
55
|
-
size_t output_num);
|
|
56
|
-
} CustomOpInfo;
|
|
57
|
-
|
|
58
|
-
/// \brief The struct to describe the extra information for single op execution.
|
|
59
|
-
typedef struct DynamicOpInfo {
|
|
60
|
-
const char **attr_names; // An array of of attribute names.
|
|
61
|
-
ValueHandle *attr_values; // An array of of attributes which has same length as [attr_names].
|
|
62
|
-
size_t attr_num; // The number of attributes.
|
|
63
|
-
int64_t **output_shapes; // An array of each output's shapes. Auto infer will be denied if specified.
|
|
64
|
-
size_t *output_dims; // An array of each output's dimension. Must be specified if [output_shapes] is not NULL.
|
|
65
|
-
DataTypeC *output_dtypes; // An array of each output's dtypes. Must be specified if [output_shapes] is not NULL.
|
|
66
|
-
} DynamicOpInfo;
|
|
67
|
-
|
|
68
|
-
/// \brief Create a new Operator node.
|
|
69
|
-
///
|
|
70
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
71
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
72
|
-
/// \param[in] op_type The primitive name.
|
|
73
|
-
/// \param[in] inputs An array of operator's input nodes.
|
|
74
|
-
/// \param[in] input_num The number of nodes in the array.
|
|
75
|
-
/// \param[in] attr_names An array of of attribute names.
|
|
76
|
-
/// \param[in] attrs An array of of attributes which has same length as [attr_names].
|
|
77
|
-
/// \param[in] attr_num The number of attributes.
|
|
78
|
-
///
|
|
79
|
-
/// \return The created Operator node handle
|
|
80
|
-
MIND_C_API NodeHandle MSNewOp(ResMgrHandle res_mgr, GraphHandle graph, const char *op_type, Handle const inputs[],
|
|
81
|
-
size_t input_num, const char *const *attr_names, ValueHandle attrs[], size_t attr_num);
|
|
82
|
-
|
|
83
|
-
/// \brief Create a tensor with input data buffer.
|
|
84
|
-
///
|
|
85
|
-
/// \param[in] op The Operator node handle.
|
|
86
|
-
/// \param[in] attr_name The attribute name.
|
|
87
|
-
/// \param[in] value The Value.
|
|
88
|
-
///
|
|
89
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
90
|
-
MIND_C_API STATUS MSOpSetAttrScalarFloat32(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, float value);
|
|
91
|
-
|
|
92
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
93
|
-
///
|
|
94
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
95
|
-
/// \param[in] op Target node.
|
|
96
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
97
|
-
/// \param[in] value The input value of the attribute.
|
|
98
|
-
///
|
|
99
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
100
|
-
MIND_C_API STATUS MSOpSetAttrScalarBool(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, bool value);
|
|
101
|
-
|
|
102
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
103
|
-
///
|
|
104
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
105
|
-
/// \param[in] op Target node.
|
|
106
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
107
|
-
/// \param[in] value The input value of the attribute.
|
|
108
|
-
///
|
|
109
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
110
|
-
MIND_C_API STATUS MSOpSetAttrScalarInt32(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, int32_t value);
|
|
111
|
-
|
|
112
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
113
|
-
///
|
|
114
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
115
|
-
/// \param[in] op Target node.
|
|
116
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
117
|
-
/// \param[in] value The input value of the attribute.
|
|
118
|
-
///
|
|
119
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
120
|
-
MIND_C_API STATUS MSOpSetAttrScalarInt64(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, int64_t value);
|
|
121
|
-
|
|
122
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
123
|
-
///
|
|
124
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
125
|
-
/// \param[in] op Target node.
|
|
126
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
127
|
-
/// \param[in] value The input value of the attribute.
|
|
128
|
-
///
|
|
129
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
130
|
-
MIND_C_API STATUS MSOpSetAttrType(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, DataTypeC value);
|
|
131
|
-
|
|
132
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
133
|
-
///
|
|
134
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
135
|
-
/// \param[in] op Target node.
|
|
136
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
137
|
-
/// \param[in] value The input value array of the attribute.
|
|
138
|
-
/// \param[in] vec_size number of elements in the array.
|
|
139
|
-
///
|
|
140
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
141
|
-
MIND_C_API STATUS MSOpSetAttrTypeArray(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, DataTypeC value[],
|
|
142
|
-
size_t vec_size);
|
|
143
|
-
|
|
144
|
-
/// \brief Set the attribute of the target node with the given name and value.
|
|
145
|
-
///
|
|
146
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
147
|
-
/// \param[in] op Target node.
|
|
148
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
149
|
-
/// \param[in] value The input value array of the attribute.
|
|
150
|
-
/// \param[in] vec_size number of elements in the array.
|
|
151
|
-
/// \param[in] data_type Data type id. Currently support kNumberTypeInt32, kNumberTypeInt64, kNumberTypeFloat32,
|
|
152
|
-
/// kNumberTypeBool.
|
|
153
|
-
///
|
|
154
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
155
|
-
MIND_C_API STATUS MSOpSetAttrArray(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, void *value,
|
|
156
|
-
size_t vec_size, DataTypeC data_type);
|
|
157
|
-
|
|
158
|
-
/// \brief Set the attribute of the target node with the given name and value as ValueList.
|
|
159
|
-
///
|
|
160
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
161
|
-
/// \param[in] op Target node.
|
|
162
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
163
|
-
/// \param[in] value The input value array of the attribute.
|
|
164
|
-
/// \param[in] vec_size Number of elements in the array.
|
|
165
|
-
///
|
|
166
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
167
|
-
MIND_C_API STATUS MSOpSetAttrStringArray(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name,
|
|
168
|
-
const char *value[], size_t vec_size);
|
|
169
|
-
|
|
170
|
-
/// \brief Set the attribute of the target node with the given name and string value.
|
|
171
|
-
///
|
|
172
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
173
|
-
/// \param[in] op Target node.
|
|
174
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
175
|
-
/// \param[in] value The input value array of the attribute.
|
|
176
|
-
///
|
|
177
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
178
|
-
MIND_C_API STATUS MSOpSetAttrString(ResMgrHandle res_mgr, NodeHandle op, const char *attr_name, const char *value);
|
|
179
|
-
|
|
180
|
-
/// \brief Get the attribute of the target node with the given attribute name.
|
|
181
|
-
///
|
|
182
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
183
|
-
/// \param[in] op Target Node.
|
|
184
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
185
|
-
/// \param[in] error Error code indicates whether the function executed successfully.
|
|
186
|
-
///
|
|
187
|
-
/// \return Value
|
|
188
|
-
MIND_C_API int64_t MSOpGetAttrScalarInt64(ResMgrHandle res_mgr, ConstNodeHandle op, const char *attr_name,
|
|
189
|
-
STATUS *error);
|
|
190
|
-
|
|
191
|
-
/// \brief Get the attribute of the target node with the given attribute name.
|
|
192
|
-
///
|
|
193
|
-
/// \param[in] res_mgr Resource Handle that manages the nodes of the funcGraph.
|
|
194
|
-
/// \param[in] op Target Node.
|
|
195
|
-
/// \param[in] attr_name The attribute name associates with the node.
|
|
196
|
-
/// \param[in] values Array for storing the Atrrubute value.
|
|
197
|
-
/// \param[in] value_num Size of the given array.
|
|
198
|
-
///
|
|
199
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
200
|
-
MIND_C_API STATUS MSOpGetAttrArrayInt64(ResMgrHandle res_mgr, ConstNodeHandle op, const char *attr_name,
|
|
201
|
-
int64_t values[], size_t value_num);
|
|
202
|
-
|
|
203
|
-
/// \brief Set Operator node name.
|
|
204
|
-
///
|
|
205
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
206
|
-
/// \param[in] node The target node.
|
|
207
|
-
/// \param[in] name The op node name to be set.
|
|
208
|
-
///
|
|
209
|
-
/// \return The error code that indicate whether the functions executed successfully.
|
|
210
|
-
MIND_C_API STATUS MSOpSetName(ResMgrHandle res_mgr, NodeHandle node, const char *name);
|
|
211
|
-
|
|
212
|
-
/// \brief Get the name of node.
|
|
213
|
-
///
|
|
214
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
215
|
-
/// \param[in] node The target node.
|
|
216
|
-
/// \param[in] str_buf The char array to contain the name string.
|
|
217
|
-
/// \param[in] str_len The size of the char array.
|
|
218
|
-
///
|
|
219
|
-
/// \return The error code that indicate whether the functions executed successfully.
|
|
220
|
-
MIND_C_API STATUS MSNodeGetName(ResMgrHandle res_mgr, ConstNodeHandle node, char str_buf[], size_t str_len);
|
|
221
|
-
|
|
222
|
-
/// \brief Pack nodes into a Tuple node.
|
|
223
|
-
///
|
|
224
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
225
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
226
|
-
/// \param[in] nodes The input nodes.
|
|
227
|
-
/// \param[in] node_num The number of nodes in the array.
|
|
228
|
-
///
|
|
229
|
-
/// \return The created Tuple node handle.
|
|
230
|
-
MIND_C_API NodeHandle MSPackNodesTuple(ResMgrHandle res_mgr, GraphHandle graph, Handle const nodes[], size_t node_num);
|
|
231
|
-
|
|
232
|
-
/// \brief Get specified output branch from a multi-output Operator.
|
|
233
|
-
///
|
|
234
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
235
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
236
|
-
/// \param[in] op The Operator.
|
|
237
|
-
/// \param[in] i The index of the output branch.
|
|
238
|
-
///
|
|
239
|
-
/// \return The obtained output node.
|
|
240
|
-
MIND_C_API NodeHandle MSOpGetSpecOutput(ResMgrHandle res_mgr, GraphHandle graph, ConstNodeHandle op, size_t i);
|
|
241
|
-
|
|
242
|
-
/// \brief Create a Switch operator for control-flow scene.
|
|
243
|
-
///
|
|
244
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
245
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
246
|
-
/// \param[in] cond The condition of Switch which can be an Operator or a Subgraph.
|
|
247
|
-
/// \param[in] true_br The true branch of Switch which must be a Subgraph.
|
|
248
|
-
/// \param[in] false_br The false branch of Switch which must be a Subgraph.
|
|
249
|
-
///
|
|
250
|
-
/// \return The created Switch operator node.
|
|
251
|
-
MIND_C_API NodeHandle MSNewSwitch(ResMgrHandle res_mgr, GraphHandle graph, Handle cond, ConstGraphHandle true_br,
|
|
252
|
-
ConstGraphHandle false_br);
|
|
253
|
-
|
|
254
|
-
/// \brief Create a While operator for control-flow scene.
|
|
255
|
-
///
|
|
256
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
257
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
258
|
-
/// \param[in] cond The condition of While which can be an Operator or a Subgraph.
|
|
259
|
-
/// \param[in] body_graph The loop body of While which must be a Subgraph.
|
|
260
|
-
/// \param[in] after_graph The graph after stepping out the While which must be a Subgraph.
|
|
261
|
-
///
|
|
262
|
-
/// \return The created While operator node.
|
|
263
|
-
MIND_C_API NodeHandle MSNewWhile(ResMgrHandle res_mgr, GraphHandle graph, Handle cond, GraphHandle body_graph,
|
|
264
|
-
GraphHandle after_graph);
|
|
265
|
-
|
|
266
|
-
/// \brief Create a custom operator.
|
|
267
|
-
///
|
|
268
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
269
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
270
|
-
/// \param[in] inputs An array of operator's input nodes.
|
|
271
|
-
/// \param[in] input_num The number of nodes in the array.
|
|
272
|
-
/// \param[in] info An CustomOpInfo struct which describes the information of custom operator.
|
|
273
|
-
///
|
|
274
|
-
/// \return The created custom operator node.
|
|
275
|
-
MIND_C_API NodeHandle MSNewCustomOp(ResMgrHandle res_mgr, GraphHandle graph, Handle const inputs[], size_t input_num,
|
|
276
|
-
CustomOpInfo info);
|
|
277
|
-
|
|
278
|
-
/// \brief Get specified input node of Operator.
|
|
279
|
-
///
|
|
280
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
281
|
-
/// \param[in] op The Operator.
|
|
282
|
-
/// \param[in] i The index of the input.
|
|
283
|
-
///
|
|
284
|
-
/// \return The obtained input node handle.
|
|
285
|
-
MIND_C_API NodeHandle MSOpGetInput(ResMgrHandle res_mgr, ConstNodeHandle op, size_t i);
|
|
286
|
-
|
|
287
|
-
/// \brief Get the input nodes number of Operator.
|
|
288
|
-
///
|
|
289
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
290
|
-
/// \param[in] op The Operator.
|
|
291
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
292
|
-
///
|
|
293
|
-
/// \return The input nodes number.
|
|
294
|
-
MIND_C_API size_t MSOpGetInputsNum(ResMgrHandle res_mgr, ConstNodeHandle op, STATUS *error);
|
|
295
|
-
|
|
296
|
-
/// \brief Get all input nodes of the Operator.
|
|
297
|
-
///
|
|
298
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
299
|
-
/// \param[in] op The Operator.
|
|
300
|
-
/// \param[in] inputs The array to contained the nodes' input.
|
|
301
|
-
/// \param[in] input_num The size of the input array.
|
|
302
|
-
///
|
|
303
|
-
/// \return Error code that indicate whether the functions executed successfully.
|
|
304
|
-
MIND_C_API STATUS MSOpGetInputs(ResMgrHandle res_mgr, ConstNodeHandle op, NodeHandle inputs[], size_t input_num);
|
|
305
|
-
|
|
306
|
-
/// \brief Get dimension value of the infer shape from the given operator.
|
|
307
|
-
///
|
|
308
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
309
|
-
/// \param[in] op The Operator.
|
|
310
|
-
/// \param[in] ret A pointer to the Error code that indicates whether the functions executed successfully.
|
|
311
|
-
///
|
|
312
|
-
/// \return Dimension Value.
|
|
313
|
-
MIND_C_API size_t MSOpGetOutputDimension(ResMgrHandle res_mgr, ConstNodeHandle op, size_t output_index, STATUS *ret);
|
|
314
|
-
|
|
315
|
-
/// \brief Get shape vector of the infer shape from the given operator.
|
|
316
|
-
///
|
|
317
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
318
|
-
/// \param[in] op The Operator.
|
|
319
|
-
/// \param[in] shape_ret The provided array for shape value storage.
|
|
320
|
-
/// \param[in] dim Dimenesion of shape, which also indicates the numbers of elements in the shape vector.
|
|
321
|
-
///
|
|
322
|
-
/// \return Error code that indicates whether the functions executed successfully.
|
|
323
|
-
MIND_C_API STATUS MSOpGetOutputShape(ResMgrHandle res_mgr, ConstNodeHandle op, int64_t shape_ret[], size_t dim,
|
|
324
|
-
size_t output_index);
|
|
325
|
-
|
|
326
|
-
/// \brief Create a subgraph node.
|
|
327
|
-
///
|
|
328
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
329
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
330
|
-
/// \param[in] sub_graph The given sub function graph pointer handle.
|
|
331
|
-
/// \param[in] inputs An array of input nodes of the subgraph node.
|
|
332
|
-
/// \param[in] input_num The number of the input array.
|
|
333
|
-
///
|
|
334
|
-
/// \return The created subgraph node handle.
|
|
335
|
-
MIND_C_API NodeHandle MSNewFuncCallNode(ResMgrHandle res_mgr, GraphHandle graph, ConstGraphHandle sub_graph,
|
|
336
|
-
Handle const inputs[], size_t input_num);
|
|
337
|
-
|
|
338
|
-
/// \brief Create a Placeholder node, which is usually the input of graph without data.
|
|
339
|
-
///
|
|
340
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
341
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
342
|
-
/// \param[in] type The data type of the Placeholder.
|
|
343
|
-
/// \param[in] shape The shape array.
|
|
344
|
-
/// \param[in] shape_size The size of shape, i.e., the dimension of the Placeholder.
|
|
345
|
-
///
|
|
346
|
-
/// \return The created Placeholder node handle.
|
|
347
|
-
MIND_C_API NodeHandle MSNewPlaceholder(ResMgrHandle res_mgr, GraphHandle graph, DataTypeC type, const int64_t shape[],
|
|
348
|
-
size_t shape_size);
|
|
349
|
-
|
|
350
|
-
/// \brief Create a Variable node of tensor without shape, which contains variable scalar data.
|
|
351
|
-
///
|
|
352
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
353
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
354
|
-
/// \param[in] value The float scalar number.
|
|
355
|
-
///
|
|
356
|
-
/// \return The created Variable node handle.
|
|
357
|
-
MIND_C_API NodeHandle MSNewVariableScalarFloat32(ResMgrHandle res_mgr, GraphHandle graph, float value);
|
|
358
|
-
|
|
359
|
-
/// \brief Create a Variable node of tensor without shape, which contains variable scalar data.
|
|
360
|
-
///
|
|
361
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
362
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
363
|
-
/// \param[in] value The int scalar number.
|
|
364
|
-
///
|
|
365
|
-
/// \return The created Variable node handle.
|
|
366
|
-
MIND_C_API NodeHandle MSNewVariableScalarInt32(ResMgrHandle res_mgr, GraphHandle graph, int value);
|
|
367
|
-
|
|
368
|
-
/// \brief Create a Variable node of tensor, which contains variable array data.
|
|
369
|
-
///
|
|
370
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
371
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
372
|
-
/// \param[in] data The data address.
|
|
373
|
-
/// \param[in] shape The shape array.
|
|
374
|
-
/// \param[in] shape_size The size of shape, i.e., the dimension of the Variable.
|
|
375
|
-
/// \param[in] type The data type of the Variable.
|
|
376
|
-
/// \param[in] data_len The length of data.
|
|
377
|
-
///
|
|
378
|
-
/// \return The created Variable node handle.
|
|
379
|
-
MIND_C_API NodeHandle MSNewVariableArray(ResMgrHandle res_mgr, GraphHandle graph, void *data, DataTypeC type,
|
|
380
|
-
const int64_t shape[], size_t shape_size, size_t data_len);
|
|
381
|
-
|
|
382
|
-
/// \brief Create a Variable node from a Tensor instance with data.
|
|
383
|
-
///
|
|
384
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
385
|
-
/// \param[in] graph The given function graph pointer handle.
|
|
386
|
-
/// \param[in] tensor The given Tensor instance.
|
|
387
|
-
///
|
|
388
|
-
/// \return The created Variable node handle.
|
|
389
|
-
MIND_C_API NodeHandle MSNewVariableFromTensor(ResMgrHandle res_mgr, GraphHandle graph, ConstTensorHandle tensor);
|
|
390
|
-
|
|
391
|
-
/// \brief Get data size of a Tensor Variable.
|
|
392
|
-
///
|
|
393
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
394
|
-
/// \param[in] node The tensor variable node
|
|
395
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
396
|
-
///
|
|
397
|
-
/// \return The data byte size.
|
|
398
|
-
MIND_C_API size_t MSVariableArrayGetDataSize(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
399
|
-
|
|
400
|
-
/// \brief Get data from a Tensor Variable.
|
|
401
|
-
///
|
|
402
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
403
|
-
/// \param[in] node The tensor variable node
|
|
404
|
-
///
|
|
405
|
-
/// \return The data.
|
|
406
|
-
MIND_C_API void *MSVariableArrayGetData(ResMgrHandle res_mgr, ConstNodeHandle node);
|
|
407
|
-
|
|
408
|
-
/// \brief Create a Constant node of tensor, which contains constant tensor data.
|
|
409
|
-
///
|
|
410
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
411
|
-
/// \param[in] data The data address.
|
|
412
|
-
/// \param[in] shape The shape array.
|
|
413
|
-
/// \param[in] shape_size The size of shape, i.e., the dimension of the Constant.
|
|
414
|
-
/// \param[in] type The data type of the Constant.
|
|
415
|
-
/// \param[in] data_len The length of data.
|
|
416
|
-
///
|
|
417
|
-
/// \return The created Constant node handle.
|
|
418
|
-
MIND_C_API NodeHandle MSNewConstantArray(ResMgrHandle res_mgr, void *data, DataTypeC type, const int64_t shape[],
|
|
419
|
-
size_t shape_size, size_t data_len);
|
|
420
|
-
|
|
421
|
-
/// \brief Create a Constant node from a Tensor instance with data.
|
|
422
|
-
///
|
|
423
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
424
|
-
/// \param[in] tensor The given Tensor instance.
|
|
425
|
-
///
|
|
426
|
-
/// \return The created Constant node handle.
|
|
427
|
-
MIND_C_API NodeHandle MSNewConstantFromTensor(ResMgrHandle res_mgr, TensorHandle tensor);
|
|
428
|
-
|
|
429
|
-
/// \brief Get data size of a Tensor Constant.
|
|
430
|
-
///
|
|
431
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
432
|
-
/// \param[in] node The tensor constant node
|
|
433
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
434
|
-
///
|
|
435
|
-
/// \return The data byte size.
|
|
436
|
-
MIND_C_API size_t MSConstantArrayGetDataSize(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
437
|
-
|
|
438
|
-
/// \brief Get data from a Tensor Constant.
|
|
439
|
-
///
|
|
440
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
441
|
-
/// \param[in] node The tensor constant node
|
|
442
|
-
///
|
|
443
|
-
/// \return The data.
|
|
444
|
-
MIND_C_API void *MSConstantArrayGetData(ResMgrHandle res_mgr, ConstNodeHandle node);
|
|
445
|
-
|
|
446
|
-
/// \brief Create Constant node of a float scalar.
|
|
447
|
-
///
|
|
448
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
449
|
-
/// \param[in] value The float32 scalar value.
|
|
450
|
-
///
|
|
451
|
-
/// \return The created Constant node handle.
|
|
452
|
-
MIND_C_API NodeHandle MSNewConstantScalarFloat32(ResMgrHandle res_mgr, float value);
|
|
453
|
-
|
|
454
|
-
/// \brief Create Constant node of a bool scalar.
|
|
455
|
-
///
|
|
456
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
457
|
-
/// \param[in] value The bool scalar value.
|
|
458
|
-
///
|
|
459
|
-
/// \return The created Constant node handle.
|
|
460
|
-
MIND_C_API NodeHandle MSNewConstantScalarBool(ResMgrHandle res_mgr, bool value);
|
|
461
|
-
|
|
462
|
-
/// \brief Create Constant node of a int32 scalar.
|
|
463
|
-
///
|
|
464
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
465
|
-
/// \param[in] value The int32 scalar value.
|
|
466
|
-
///
|
|
467
|
-
/// \return The created Constant node handle.
|
|
468
|
-
MIND_C_API NodeHandle MSNewConstantScalarInt32(ResMgrHandle res_mgr, int value);
|
|
469
|
-
|
|
470
|
-
/// \brief Create Constant node of a int64 scalar.
|
|
471
|
-
///
|
|
472
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
473
|
-
/// \param[in] value The int64 scalar value.
|
|
474
|
-
///
|
|
475
|
-
/// \return The created Constant node handle.
|
|
476
|
-
MIND_C_API NodeHandle MSNewConstantScalarInt64(ResMgrHandle res_mgr, int64_t value);
|
|
477
|
-
|
|
478
|
-
/// \brief Create Constant node of a int64 tuple.
|
|
479
|
-
///
|
|
480
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
481
|
-
/// \param[in] vec The array of int64 value.
|
|
482
|
-
/// \param[in] vec The size of the value.
|
|
483
|
-
///
|
|
484
|
-
/// \return The created Constant node handle.
|
|
485
|
-
MIND_C_API NodeHandle MSNewConstantTupleInt64(ResMgrHandle res_mgr, const int64_t vec[], size_t size);
|
|
486
|
-
|
|
487
|
-
/// \brief Create Constant node of a string.
|
|
488
|
-
///
|
|
489
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
490
|
-
/// \param[in] str The string.
|
|
491
|
-
///
|
|
492
|
-
/// \return The created Constant node handle.
|
|
493
|
-
MIND_C_API NodeHandle MSNewConstantString(ResMgrHandle res_mgr, const char *str);
|
|
494
|
-
|
|
495
|
-
/// \brief Create Constant node of a type.
|
|
496
|
-
///
|
|
497
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
498
|
-
/// \param[in] str The type.
|
|
499
|
-
///
|
|
500
|
-
/// \return The created Constant node handle.
|
|
501
|
-
MIND_C_API NodeHandle MSNewConstantType(ResMgrHandle res_mgr, DataTypeC type);
|
|
502
|
-
|
|
503
|
-
/// \brief Get value from the int32 scalar Constant node.
|
|
504
|
-
///
|
|
505
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
506
|
-
/// \param[in] node The Constant node.
|
|
507
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
508
|
-
///
|
|
509
|
-
/// \return The obtained int32 value.
|
|
510
|
-
MIND_C_API int MSConstantScalarGetValueInt32(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
511
|
-
|
|
512
|
-
/// \brief Get value from the float32 scalar Constant node.
|
|
513
|
-
///
|
|
514
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
515
|
-
/// \param[in] node The Constant node.
|
|
516
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
517
|
-
///
|
|
518
|
-
/// \return The obtained float32 value.
|
|
519
|
-
MIND_C_API float MSConstantScalarGetValueFloat32(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
520
|
-
|
|
521
|
-
/// \brief Get value from the bool scalar Constant node.
|
|
522
|
-
///
|
|
523
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
524
|
-
/// \param[in] node The Constant node.
|
|
525
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
526
|
-
///
|
|
527
|
-
/// \return The obtained bool value.
|
|
528
|
-
MIND_C_API bool MSConstantScalarGetValueBool(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
529
|
-
|
|
530
|
-
/// \brief Get value from the int64 scalar Constant node.
|
|
531
|
-
///
|
|
532
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
533
|
-
/// \param[in] node The Constant node.
|
|
534
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
535
|
-
///
|
|
536
|
-
/// \return The obtained int64 value.
|
|
537
|
-
MIND_C_API int64_t MSConstantScalarGetValueInt64(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
538
|
-
|
|
539
|
-
/// \brief Get value from the string Constant node.
|
|
540
|
-
///
|
|
541
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
542
|
-
/// \param[in] node The Constant node.
|
|
543
|
-
/// \param[in] str_buf The char array to contain the string.
|
|
544
|
-
/// \param[in] str_len The size of the char array.
|
|
545
|
-
///
|
|
546
|
-
/// \return The error code that indicate whether the functions executed successfully.
|
|
547
|
-
MIND_C_API STATUS MSConstantStringGetValue(ResMgrHandle res_mgr, ConstNodeHandle node, char str_buf[], size_t str_len);
|
|
548
|
-
|
|
549
|
-
/// \brief Get value from the tuple Constant node.
|
|
550
|
-
///
|
|
551
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
552
|
-
/// \param[in] node The Constant node.
|
|
553
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
554
|
-
///
|
|
555
|
-
/// \return The size of the Tuple.
|
|
556
|
-
MIND_C_API size_t MSConstantTupleGetSize(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
557
|
-
|
|
558
|
-
/// \brief Get value from the Tuple Constant node.
|
|
559
|
-
///
|
|
560
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
561
|
-
/// \param[in] node The Constant node.
|
|
562
|
-
/// \param[in] vec The int64 array to contain the value.
|
|
563
|
-
/// \param[in] size The size of the value vector.
|
|
564
|
-
///
|
|
565
|
-
/// \return The error code that indicate whether the functions executed successfully.
|
|
566
|
-
MIND_C_API STATUS MSConstantTupleGetValueInt64(ResMgrHandle res_mgr, ConstNodeHandle node, int64_t vec[], size_t size);
|
|
567
|
-
|
|
568
|
-
/// \brief Get value from the Type Constant node.
|
|
569
|
-
///
|
|
570
|
-
/// \param[in] res_mgr Resource manager that saves allocated instance resources.
|
|
571
|
-
/// \param[in] node The Constant node.
|
|
572
|
-
/// \param[in] error Records error code that indicate whether the functions executed successfully.
|
|
573
|
-
///
|
|
574
|
-
/// \return The obtained type value.
|
|
575
|
-
MIND_C_API DataTypeC MSConstantTypeGetValue(ResMgrHandle res_mgr, ConstNodeHandle node, STATUS *error);
|
|
576
|
-
|
|
577
|
-
/// \brief Run single op in eager way.
|
|
578
|
-
///
|
|
579
|
-
/// \param[in] op_type The primitive name.
|
|
580
|
-
/// \param[in] inputs An array of operator's input nodes.
|
|
581
|
-
/// \param[in] input_num The number of nodes in the array.
|
|
582
|
-
/// \param[in] outputs An array to store outputs tensor which is allocated by used.
|
|
583
|
-
/// \param[in] output_num The number of outputs.
|
|
584
|
-
///
|
|
585
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
586
|
-
MIND_C_API STATUS MSRunOp(ResMgrHandle res_mgr, const char *op_type, TensorHandle const inputs[], size_t input_num,
|
|
587
|
-
TensorHandle outputs[], size_t output_num);
|
|
588
|
-
|
|
589
|
-
/// \brief Run single op with extra information in eager way.
|
|
590
|
-
///
|
|
591
|
-
/// \param[in] op_type The primitive name.
|
|
592
|
-
/// \param[in] inputs An array of operator's input nodes.
|
|
593
|
-
/// \param[in] input_num The number of nodes in the array.
|
|
594
|
-
/// \param[in] outputs An array to store outputs tensor which is allocated by used.
|
|
595
|
-
/// \param[in] output_num The number of outputs.
|
|
596
|
-
/// \param[in] extra_info A struct that holds the extra information
|
|
597
|
-
///
|
|
598
|
-
/// \return Error code indicates whether the function executed successfully.
|
|
599
|
-
MIND_C_API STATUS MSRunOpWithInfo(ResMgrHandle res_mgr, const char *op_type, TensorHandle const inputs[],
|
|
600
|
-
size_t input_num, TensorHandle outputs[], size_t output_num,
|
|
601
|
-
DynamicOpInfo extra_info);
|
|
602
|
-
|
|
603
|
-
#ifdef __cplusplus
|
|
604
|
-
}
|
|
605
|
-
#endif
|
|
606
|
-
#endif // MINDSPORE_CCSRC_C_API_INCLUDE_NODE_H_
|