1 /** 2 * Copyright 2021 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 #include "include/api/graph.h" 18 #include "include/api/cell.h" 19 #include "src/litert/cxx_api/graph/graph_data.h" 20 21 namespace mindspore { Graph()22Graph::Graph() : graph_data_(nullptr) {} 23 Graph(const std::shared_ptr<GraphData> & graph_data)24Graph::Graph(const std::shared_ptr<GraphData> &graph_data) : graph_data_(graph_data) {} 25 Graph(std::shared_ptr<GraphData> && graph_data)26Graph::Graph(std::shared_ptr<GraphData> &&graph_data) : graph_data_(graph_data) {} 27 ~Graph()28Graph::~Graph() {} 29 Graph(std::nullptr_t)30Graph::Graph(std::nullptr_t) : graph_data_(nullptr) {} 31 operator ==(std::nullptr_t) const32bool Graph::operator==(std::nullptr_t) const { return graph_data_ == nullptr; } 33 operator !=(std::nullptr_t) const34bool Graph::operator!=(std::nullptr_t) const { return graph_data_ != nullptr; } 35 ModelType() const36ModelType Graph::ModelType() const { return kMindIR_Lite; } 37 } // namespace mindspore 38