• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/cell.h"
18 #include "src/common/log_adapter.h"
19 
20 namespace mindspore {
21 class GraphImpl {};
22 
operator ()(const std::vector<Input> & inputs) const23 std::vector<Output> CellBase::operator()(const std::vector<Input> &inputs) const {
24   std::vector<Output> empty;
25   MS_LOG(ERROR) << "Unsupported feature.";
26   return empty;
27 }
28 
ParameterCell(const ParameterCell & cell)29 ParameterCell::ParameterCell(const ParameterCell &cell) { MS_LOG(ERROR) << "Unsupported feature."; }
operator =(const ParameterCell & cell)30 ParameterCell &ParameterCell::operator=(const ParameterCell &cell) {
31   MS_LOG(ERROR) << "Unsupported feature.";
32   return *this;
33 }
34 
ParameterCell(ParameterCell && cell)35 ParameterCell::ParameterCell(ParameterCell &&cell) { MS_LOG(ERROR) << "Unsupported feature."; }
36 
operator =(ParameterCell && cell)37 ParameterCell &ParameterCell::operator=(ParameterCell &&cell) {
38   MS_LOG(ERROR) << "Unsupported feature.";
39   return *this;
40 }
41 
ParameterCell(const MSTensor & tensor)42 ParameterCell::ParameterCell(const MSTensor &tensor) { MS_LOG(ERROR) << "Unsupported feature."; }
43 
operator =(const MSTensor & tensor)44 ParameterCell &ParameterCell::operator=(const MSTensor &tensor) {
45   MS_LOG(ERROR) << "Unsupported feature.";
46   return *this;
47 }
48 
ParameterCell(MSTensor && tensor)49 ParameterCell::ParameterCell(MSTensor &&tensor) : tensor_(tensor) { MS_LOG(ERROR) << "Unsupported feature."; }
50 
operator =(MSTensor && tensor)51 ParameterCell &ParameterCell::operator=(MSTensor &&tensor) {
52   MS_LOG(ERROR) << "Unsupported feature.";
53   return *this;
54 }
55 
GraphCell(const Graph & graph)56 GraphCell::GraphCell(const Graph &graph) : graph_(std::shared_ptr<Graph>(new (std::nothrow) Graph(graph))) {
57   if (graph_ == nullptr) {
58     MS_LOG(ERROR) << "Invalid graph.";
59   }
60 }
61 
GraphCell(const std::shared_ptr<Graph> & graph)62 GraphCell::GraphCell(const std::shared_ptr<Graph> &graph) : graph_(graph) {
63   if (graph_ == nullptr) {
64     MS_LOG(ERROR) << "Invalid graph.";
65   }
66 }
67 
GraphCell(Graph && graph)68 GraphCell::GraphCell(Graph &&graph) : graph_(std::shared_ptr<Graph>(new (std::nothrow) Graph(graph))) {
69   if (graph_ == nullptr) {
70     MS_LOG(ERROR) << "Invalid graph.";
71   }
72 }
73 
Run(const std::vector<MSTensor> & inputs,std::vector<MSTensor> * outputs)74 Status GraphCell::Run(const std::vector<MSTensor> &inputs, std::vector<MSTensor> *outputs) {
75   MS_LOG(ERROR) << "Unsupported feature.";
76   return kLiteError;
77 }
78 
Load(uint32_t device_id)79 Status GraphCell::Load(uint32_t device_id) {
80   MS_LOG(ERROR) << "Unsupported feature.";
81   return kLiteError;
82 }
83 
InputAndOutput()84 InputAndOutput::InputAndOutput() { MS_LOG(ERROR) << "Unsupported feature."; }
85 
InputAndOutput(const MSTensor & tensor)86 InputAndOutput::InputAndOutput(const MSTensor &tensor) { MS_LOG(ERROR) << "Unsupported feature."; }
InputAndOutput(MSTensor && tensor)87 InputAndOutput::InputAndOutput(MSTensor &&tensor) { MS_LOG(ERROR) << "Unsupported feature."; }
88 
InputAndOutput(const std::shared_ptr<CellBase> & cell,const std::vector<InputAndOutput> & prev,int32_t index)89 InputAndOutput::InputAndOutput(const std::shared_ptr<CellBase> &cell, const std::vector<InputAndOutput> &prev,
90                                int32_t index) {
91   MS_LOG(ERROR) << "Unsupported feature.";
92 }
93 }  // namespace mindspore
94