ONE - On-device Neural Engine
Loading...
Searching...
No Matches
exo::CircleExporter Class Reference

#include <CircleExporter.h>

Data Structures

class  Impl
 

Public Member Functions

 CircleExporter (loco::Graph *graph)
 
 ~CircleExporter ()
 
void dumpToFile (const char *path) const
 write to a file
 

Detailed Description

HOW TO USE:

loco::Graph *g = ...;

CircleExporter e(g); e.dumpToFile("model.circle");

HOW TO USE (simplified):

CircleExporter(g).dumpToFile("model.circle");

Definition at line 40 of file CircleExporter.h.

Constructor & Destructor Documentation

◆ CircleExporter()

exo::CircleExporter::CircleExporter ( loco::Graph graph)
explicit

Definition at line 29 of file CircleExporter.cpp.

29 : _impl(std::make_unique<Impl>(graph))
30{
31 // NOTHING TO DO
32}

◆ ~CircleExporter()

exo::CircleExporter::~CircleExporter ( )
default

Member Function Documentation

◆ dumpToFile()

void exo::CircleExporter::dumpToFile ( const char *  path) const

write to a file

Parameters
pathpath to file where to write data
Exceptions
anyfile related exceptions

Definition at line 36 of file CircleExporter.cpp.

37{
38 const char *ptr = _impl->getBufferPointer();
39 const size_t size = _impl->getBufferSize();
40
41 if (!ptr)
42 INTERNAL_EXN("Graph was not serialized by FlatBuffer for some reason");
43
44 std::ofstream file(path, std::ofstream::binary);
45 file.write(ptr, size);
46}
#define INTERNAL_EXN(msg)
@ brief throw internal exception with message
Definition InternalExn.h:25
int32_t size[5]
Definition Slice.cpp:35

References INTERNAL_EXN, and size.

Referenced by main(), and main().


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