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.

caffe_data_parser.h 2.1 kB

5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
  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 PARSER_CAFFE_CAFFE_DATA_PARSER_H_
  17. #define PARSER_CAFFE_CAFFE_DATA_PARSER_H_
  18. #include <string>
  19. #include <vector>
  20. #include "parser/caffe/caffe_op_parser.h"
  21. #include "parser/common/data_op_parser.h"
  22. namespace ge {
  23. class PARSER_FUNC_VISIBILITY CaffeDataParser : public CaffeOpParser, public DataOpParser {
  24. public:
  25. /**
  26. * @ingroup domi_omg
  27. * @brief parse params of the operation
  28. * @param [in] op_src params to be parsed
  29. * @param [out] graph params after parsing
  30. * @return SUCCESS parse successfully
  31. * @return FAILED parse failed
  32. */
  33. Status ParseParams(const Message *op_src, ge::OpDescPtr &op) override;
  34. private:
  35. /**
  36. * @ingroup domi_omg
  37. * @brief Get the output dimension according to the input dimension
  38. * @param [in] name the name of the input layer
  39. * @param [in] input_dims the dimension of the input layer
  40. * @param [out] op_def op after parsing
  41. * @return SUCCESS parse successfully
  42. * @return FAILED parse failed
  43. */
  44. Status GetOutputDesc(const std::string &name, const std::vector<int64_t> &input_dims, const ge::OpDescPtr &op) const;
  45. // caffe data layer type could be type of `Input` or `DummyData`
  46. Status ParseParamsForInput(const domi::caffe::LayerParameter &layer, ge::OpDescPtr &op) const;
  47. Status ParseParamsForDummyData(const domi::caffe::LayerParameter &layer, ge::OpDescPtr &op) const;
  48. };
  49. } // namespace ge
  50. #endif // PARSER_CAFFE_CAFFE_DATA_PARSER_H_