File: ISerializer.hpp

package info (click to toggle)
armnn 20.08-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 20,472 kB
  • sloc: cpp: 211,547; python: 2,756; sh: 285; makefile: 38; asm: 6
file content (37 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (2)
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
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once

#include "armnn/INetwork.hpp"
#include "armnn/NetworkFwd.hpp"
#include "armnn/Types.hpp"

namespace armnnSerializer
{

class ISerializer;
using ISerializerPtr = std::unique_ptr<ISerializer, void(*)(ISerializer* serializer)>;

class ISerializer
{
public:
    static ISerializer* CreateRaw();
    static ISerializerPtr Create();
    static void Destroy(ISerializer* serializer);

    /// Serializes the network to ArmNN SerializedGraph.
    /// @param [in] inNetwork The network to be serialized.
    virtual void Serialize(const armnn::INetwork& inNetwork) = 0;

    /// Serializes the SerializedGraph to the stream.
    /// @param [stream] the stream to save to
    /// @return true if graph is Serialized to the Stream, false otherwise
    virtual bool SaveSerializedToStream(std::ostream& stream) = 0;

protected:
    virtual ~ISerializer() {}
};

} //namespace armnnSerializer