You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ge_mock.cc 1.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Copyright 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. #ifndef GE_MOCK_H
  17. #define GE_MOCK_H
  18. #include <iostream>
  19. #include <memory>
  20. #include <string>
  21. #include <cstring>
  22. #include <sstream>
  23. #include "graph/tensor.h"
  24. #include "graph/operator_reg.h"
  25. #include "graph/operator.h"
  26. #include "graph/utils/tensor_utils.h"
  27. #include "graph/utils/tensor_adapter.h"
  28. #include "external/ge/ge_api.h"
  29. namespace ge {
  30. Session::Session(const std::map<std::string, std::string>& options) {}
  31. Session::~Session() {}
  32. Status Session::RunGraph(uint32_t id, const std::vector<Tensor>& inputs, std::vector<Tensor>& outputs) {
  33. // for test!!! just copy inputs to outputs:
  34. for (auto it = inputs.begin(); it != inputs.end(); it++) {
  35. outputs.emplace_back(*it);
  36. }
  37. return ge::GRAPH_SUCCESS;
  38. }
  39. Status Session::AddGraph(uint32_t id, const Graph& graph) { return ge::GRAPH_SUCCESS; }
  40. Status GEInitialize(const std::map<std::string, std::string>& options) { return ge::GRAPH_SUCCESS; }
  41. Status GEFinalize() { return ge::GRAPH_SUCCESS; }
  42. Status Graph::SaveToFile(const string& file_name) const { return ge::GRAPH_SUCCESS; }
  43. } // namespace ge
  44. #endif