Program Listing for File node_parser.h
↰ Return to documentation for file (include/node_parser.h
)
#ifndef MINDSPORE_LITE_INCLUDE_REGISTRY_NODE_PARSER_H_
#define MINDSPORE_LITE_INCLUDE_REGISTRY_NODE_PARSER_H_
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "include/registry/converter_context.h"
namespace onnx {
class GraphProto;
class NodeProto;
} // namespace onnx
namespace caffe {
class LayerParameter;
} // namespace caffe
namespace tensorflow {
class NodeDef;
} // namespace tensorflow
namespace tflite {
struct OperatorT;
struct SubGraphT;
struct ModelT;
} // namespace tflite
namespace mindspore {
namespace ops {
class PrimitiveC;
} // namespace ops
namespace converter {
class NodeParser {
public:
NodeParser() = default;
virtual ~NodeParser() = default;
virtual ops::PrimitiveC *Parse(const onnx::GraphProto &onnx_graph, const onnx::NodeProto &onnx_node) {
return nullptr;
}
virtual ops::PrimitiveC *Parse(const caffe::LayerParameter &proto, const caffe::LayerParameter &weight) {
return nullptr;
}
virtual ops::PrimitiveC *Parse(const tensorflow::NodeDef &tf_op,
const std::map<std::string, const tensorflow::NodeDef *> &tf_node_map,
std::vector<std::string> *inputs, int *output_size) {
return nullptr;
}
virtual ops::PrimitiveC *Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::unique_ptr<tflite::SubGraphT> &tflite_subgraph,
const std::unique_ptr<tflite::ModelT> &tflite_model) {
return nullptr;
}
};
using NodeParserPtr = std::shared_ptr<NodeParser>;
} // namespace converter
} // namespace mindspore
#endif // MINDSPORE_LITE_INCLUDE_REGISTRY_NODE_PARSER_H_