ArmNN
 25.11
Loading...
Searching...
No Matches
ISerializer.hpp
Go to the documentation of this file.
1//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include "armnn/INetwork.hpp"
9#include "armnn/Types.hpp"
10
12{
13
14class ISerializer;
15using ISerializerPtr = std::unique_ptr<ISerializer, void(*)(ISerializer* serializer)>;
16
17class ISerializer
18{
19public:
20 static ISerializer* CreateRaw();
21 static ISerializerPtr Create();
22 static void Destroy(ISerializer* serializer);
23
24 /// Serializes the network to ArmNN SerializedGraph.
25 /// @param [in] inNetwork The network to be serialized.
26 void Serialize(const armnn::INetwork& inNetwork);
27
28 /// Serializes the SerializedGraph to the stream.
29 /// @param [stream] the stream to save to
30 /// @return true if graph is Serialized to the Stream, false otherwise
31 bool SaveSerializedToStream(std::ostream& stream);
32
33private:
34 ISerializer();
35 ~ISerializer();
36
37 class SerializerImpl;
38 std::unique_ptr<SerializerImpl> pSerializerImpl;
39};
40
41} //namespace armnnSerializer
Main network class which provides the interface for building up a neural network.
Definition INetwork.hpp:348
bool SaveSerializedToStream(std::ostream &stream)
Serializes the SerializedGraph to the stream.
static ISerializerPtr Create()
void Serialize(const armnn::INetwork &inNetwork)
Serializes the network to ArmNN SerializedGraph.
static ISerializer * CreateRaw()
static void Destroy(ISerializer *serializer)
std::unique_ptr< ISerializer, void(*)(ISerializer *serializer)> ISerializerPtr