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_custom_parser_adapter.h 2.5 kB

4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_CUSTOM_PARSER_ADAPTER_H_
  17. #define PARSER_CAFFE_CAFFE_CUSTOM_PARSER_ADAPTER_H_
  18. #include "parser/caffe/caffe_op_parser.h"
  19. namespace ge {
  20. class PARSER_FUNC_VISIBILITY CaffeCustomParserAdapter : public CaffeOpParser {
  21. public:
  22. /**
  23. * @ingroup domi_omg
  24. * @brief parse params of the operation
  25. * @param [in] op_src params to be parsed
  26. * @param [out] op_dest params after parsing
  27. * @return SUCCESS parse successfully
  28. * @return FAILED parse failed
  29. * @author
  30. */
  31. Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override;
  32. /**
  33. * @ingroup domi_omg
  34. * @brief parse params of the operation
  35. * @param [in] op_src params to be parsed
  36. * @param [out] op_dest params after parsing
  37. * @return SUCCESS parse successfully
  38. * @return FAILED parse failed
  39. * @author
  40. */
  41. static Status ParseParams(const Operator &op_src, const ge::OpDescPtr &op_dest);
  42. /**
  43. * @ingroup domi_omg
  44. * @brief parse weight of the operation
  45. * @param [in] op_src params to be parsed
  46. * @param [out] node params after parsing
  47. * @return SUCCESS parse successfullyparse failed
  48. * @return FAILED
  49. * @author
  50. */
  51. Status ParseWeights(const Message *op_src, ge::NodePtr &node) override;
  52. /**
  53. * @ingroup domi_omg
  54. * @brief parse weight of the operation
  55. * @param [in] const_node const node to add link edge
  56. * @param [in] index index of current node to add link
  57. * @param [in] update_in_turn flag of update in turn
  58. * @param [out] node params after parsing
  59. * @return SUCCESS parse successfullyparse failed
  60. * @return FAILED
  61. * @author
  62. */
  63. Status AddEdgeFromConstNode(const NodePtr &const_node, const int32_t index,
  64. const bool update_in_turn, ge::NodePtr &node) const;
  65. };
  66. } // namespace ge
  67. #endif // PARSER_CAFFE_CAFFE_CUSTOM_PARSER_ADAPTER_H_