blob: 55fc85052b0ff79bcd10fa6033764dde2c7353cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// See LICENSE file in the project root for full license information.
//
#pragma once
#include "armnn/Types.hpp"
#include "armnn/NetworkFwd.hpp"
#include "armnn/Tensor.hpp"
#include "armnn/INetwork.hpp"
#include <memory>
#include <map>
#include <vector>
namespace armnnCaffeParser
{
using BindingPointInfo = std::pair<armnn::LayerBindingId, armnn::TensorInfo>;
class ICaffeParser;
using ICaffeParserPtr = std::unique_ptr<ICaffeParser, void(*)(ICaffeParser* parser)>;
class ICaffeParser
{
public:
static ICaffeParser* CreateRaw();
static ICaffeParserPtr Create();
static void Destroy(ICaffeParser* parser);
/// Create the network from a protobuf text file on disk
virtual armnn::INetworkPtr CreateNetworkFromTextFile(
const char* graphFile,
const std::map<std::string, armnn::TensorShape>& inputShapes,
const std::vector<std::string>& requestedOutputs) = 0;
/// Create the network from a protobuf binary file on disk
virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(
const char* graphFile,
const std::map<std::string, armnn::TensorShape>& inputShapes,
const std::vector<std::string>& requestedOutputs) = 0;
/// Create the network directly from protobuf text in a string. Useful for debugging/testing
virtual armnn::INetworkPtr CreateNetworkFromString(
const char* protoText,
const std::map<std::string, armnn::TensorShape>& inputShapes,
const std::vector<std::string>& requestedOutputs) = 0;
/// Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name
virtual BindingPointInfo GetNetworkInputBindingInfo(const std::string& name) const = 0;
/// Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name
virtual BindingPointInfo GetNetworkOutputBindingInfo(const std::string& name) const = 0;
protected:
virtual ~ICaffeParser() {};
};
}
|