1 /** 2 * Copyright 2019-2020 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_TRANSFORM_GRAPH_IR_TYPES_H_ 18 #define MINDSPORE_CCSRC_TRANSFORM_GRAPH_IR_TYPES_H_ 19 20 #include <string> 21 #include <vector> 22 #include <map> 23 #include <memory> 24 #include <unordered_map> 25 #include "ir/anf.h" 26 #include "ir/dtype.h" 27 #include "ir/tensor.h" 28 29 #include "graph/tensor.h" 30 #ifdef OPEN_SOURCE 31 #include "ge/client/ge_api.h" 32 #else 33 #include "external/ge/ge_api.h" 34 #endif 35 using GeTensor = ge::Tensor; 36 37 namespace mindspore { 38 namespace transform { 39 enum Status : int { SUCCESS = 0, FAILED, INVALID_ARGUMENT, ALREADY_EXISTS, NOT_FOUND }; 40 41 using MeTensor = mindspore::tensor::Tensor; 42 using MeTensorPtr = std::shared_ptr<MeTensor>; 43 using MeDataType = mindspore::TypeId; 44 using GeDataType = ge::DataType; 45 using GeFormat = ge::Format; 46 using GeShape = ge::Shape; 47 using GeTensorPtr = std::shared_ptr<GeTensor>; 48 using GeTensorDesc = ge::TensorDesc; 49 using AnfGraph = FuncGraph; 50 using AnfGraphPtr = FuncGraphPtr; 51 using Operator = ge::Operator; 52 using OperatorPtr = std::shared_ptr<ge::Operator>; 53 using DfGraph = ge::Graph; 54 using DfGraphPtr = std::shared_ptr<DfGraph>; 55 using TensorMap = std::unordered_map<std::string, std::shared_ptr<MeTensor>>; 56 } // namespace transform 57 } // namespace mindspore 58 59 #endif // MINDSPORE_CCSRC_TRANSFORM_GRAPH_IR_TYPES_H_ 60