ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::Frontend Class Reference

#include <Frontend.h>

Public Types

enum class  FileType { Text , Binary }
 

Public Member Functions

 Frontend ()
 
std::unique_ptr< loco::Graphload (const ModelSignature &, const char *, FileType) const
 
std::unique_ptr< loco::Graphload (const ModelSignature &, std::istream *, FileType) const
 

Detailed Description

Definition at line 31 of file Frontend.h.

Member Enumeration Documentation

◆ FileType

enum class moco::tf::Frontend::FileType
strong
Enumerator
Text 
Binary 

Definition at line 34 of file Frontend.h.

Constructor & Destructor Documentation

◆ Frontend()

Frontend::Frontend ( )

Definition at line 188 of file Frontend.cpp.

189{
190 // DO NOTHING
191}

Member Function Documentation

◆ load() [1/2]

std::unique_ptr< loco::Graph > Frontend::load ( const ModelSignature signature,
const char *  modelfile,
FileType  type 
) const

Definition at line 193 of file Frontend.cpp.

195{
196 // Using c++ standard library, rather than file descriptor, makes these lines portable
197 std::ifstream ifs{modelfile, std::ios::in | std::ios::binary};
198 return load(signature, &ifs, type);
199}
std::unique_ptr< loco::Graph > load(const ModelSignature &, const char *, FileType) const
Definition Frontend.cpp:193

References load().

Referenced by load().

◆ load() [2/2]

std::unique_ptr< loco::Graph > Frontend::load ( const ModelSignature signature,
std::istream *  stream,
FileType  type 
) const

Definition at line 201 of file Frontend.cpp.

203{
204 tensorflow::GraphDef tf_graph_def;
205
206 load_tf(stream, type, tf_graph_def);
207
208 transform_tf(signature, tf_graph_def);
209
210 auto graph = import(signature, tf_graph_def);
211
212 return std::move(graph);
213}

The documentation for this class was generated from the following files: