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_SRC_COMMON_H_ 18 #define MINDSPORE_CCSRC_C_API_SRC_COMMON_H_ 19 20 #include <string> 21 #include <memory> 22 #include "ir/func_graph.h" 23 #include "ops/primitive_c.h" 24 #include "frontend/optimizer/opt.h" 25 #include "frontend/optimizer/irpass.h" 26 #include "pipeline/pynative/base.h" 27 #include "pipeline/pynative/forward/forward.h" 28 #include "backend/graph_compiler/backend.h" 29 30 using FuncGraphImpl = mindspore::FuncGraph; 31 using FuncGraphManagerImpl = mindspore::FuncGraphManager; 32 using AnfNodeImpl = mindspore::AnfNode; 33 using ParameterImpl = mindspore::Parameter; 34 using ValueNodeImpl = mindspore::ValueNode; 35 using CNodeImpl = mindspore::CNode; 36 using PrimitiveImpl = mindspore::Primitive; 37 using TensorImpl = mindspore::tensor::Tensor; 38 using ScalarImpl = mindspore::Scalar; 39 using TypeImpl = mindspore::Type; 40 using TensorTypeImpl = mindspore::TensorType; 41 using AbstractBaseImpl = mindspore::abstract::AbstractBase; 42 using AbstractTensorImpl = mindspore::abstract::AbstractTensor; 43 using AbstractScalarImpl = mindspore::abstract::AbstractScalar; 44 using AbstractTupleImpl = mindspore::abstract::AbstractTuple; 45 using ValueSequenceImpl = mindspore::ValueSequence; 46 using AbstractTypeImpl = mindspore::abstract::AbstractType; 47 using ValueImpl = mindspore::Value; 48 using ValueTupleImpl = mindspore::ValueTuple; 49 using StringImmImpl = mindspore::StringImm; 50 using BoolImmImpl = mindspore::BoolImm; 51 using Int8ImmImpl = mindspore::Int8Imm; 52 using Int16ImmImpl = mindspore::Int16Imm; 53 using Int32ImmImpl = mindspore::Int32Imm; 54 using Int64ImmImpl = mindspore::Int64Imm; 55 using UInt8ImmImpl = mindspore::UInt8Imm; 56 using Float32ImmImpl = mindspore::FP32Imm; 57 58 using BasePtr = mindspore::BasePtr; 59 using ValuePtr = mindspore::ValuePtr; 60 using TypePtr = mindspore::TypePtr; 61 using TensorTypePtr = mindspore::TensorTypePtr; 62 using ScalarPtr = mindspore::ScalarPtr; 63 using Int32ImmPtr = mindspore::Int32ImmPtr; 64 using Int64ImmPtr = mindspore::Int64ImmPtr; 65 using Float32ImmPtr = mindspore::FP32ImmPtr; 66 using BoolImmPtr = mindspore::BoolImmPtr; 67 using StringImmPtr = mindspore::StringImmPtr; 68 using ValueTuplePtr = mindspore::ValueTuplePtr; 69 using ValueSequencePtr = mindspore::ValueSequencePtr; 70 using TensorPtr = mindspore::tensor::TensorPtr; 71 using PrimitivePtr = mindspore::PrimitivePtr; 72 using AnfNodePtr = mindspore::AnfNodePtr; 73 using ValueNodePtr = mindspore::ValueNodePtr; 74 using CNodePtr = mindspore::CNodePtr; 75 using ParameterPtr = mindspore::ParameterPtr; 76 using AbstractBasePtr = mindspore::abstract::AbstractBasePtr; 77 using AbstractTensorPtr = mindspore::abstract::AbstractTensorPtr; 78 using AbstractScalarPtr = mindspore::abstract::AbstractScalarPtr; 79 using FuncGraphPtr = mindspore::FuncGraphPtr; 80 using FuncGraphManagerPtr = std::shared_ptr<mindspore::FuncGraphManager>; 81 using BaseShapePtr = mindspore::abstract::BaseShapePtr; 82 using ShapePtr = mindspore::abstract::ShapePtr; 83 using Shape = mindspore::abstract::Shape; 84 using TupleShape = mindspore::abstract::TupleShape; 85 86 using OptPassConfig = mindspore::opt::OptPassConfig; 87 using SubstitutionPtr = mindspore::opt::SubstitutionPtr; 88 using OptPassGroupMap = mindspore::opt::OptPassGroupMap; 89 90 using AttrMap = mindspore::HashMap<std::string, ValuePtr>; 91 using FrontendOpRunInfoPtr = mindspore::pynative::FrontendOpRunInfoPtr; 92 using ForwardExecutorPtr = std::shared_ptr<mindspore::pynative::ForwardExecutor>; 93 using MindRTBackendPtr = mindspore::compile::MindRTBackendPtr; 94 #endif // MINDSPORE_CCSRC_C_API_SRC_COMMON_H_ 95