ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::CircleFileExpContract Struct Reference

#include <CircleFileExpContract.h>

Collaboration diagram for luci::CircleFileExpContract:

Public Member Functions

 CircleFileExpContract (luci::Module *module, const std::string &filename)
 
virtual ~CircleFileExpContract ()=default
 
luci::Modulemodule (void) const final
 
bool store (const char *ptr, const size_t size) const final
 
- Public Member Functions inherited from luci::CircleExporter::Contract
virtual ~Contract ()=default
 

Detailed Description

Definition at line 32 of file CircleFileExpContract.h.

Constructor & Destructor Documentation

◆ CircleFileExpContract()

luci::CircleFileExpContract::CircleFileExpContract ( luci::Module module,
const std::string &  filename 
)
inline

Definition at line 35 of file CircleFileExpContract.h.

36 : _module(module), _filepath(filename)
37 {
38 // NOTHING TO DO
39 }
luci::Module * module(void) const final

◆ ~CircleFileExpContract()

virtual luci::CircleFileExpContract::~CircleFileExpContract ( )
virtualdefault

Member Function Documentation

◆ module()

luci::Module * luci::CircleFileExpContract::module ( void  ) const
inlinefinalvirtual

Implements luci::CircleExporter::Contract.

Definition at line 43 of file CircleFileExpContract.h.

43{ return _module; }

◆ store()

bool luci::CircleFileExpContract::store ( const char *  ptr,
const size_t  size 
) const
inlinefinalvirtual

Implements luci::CircleExporter::Contract.

Definition at line 46 of file CircleFileExpContract.h.

47 {
48 if (!ptr)
49 INTERNAL_EXN("Graph was not serialized by FlatBuffer for some reason");
50
51 std::ofstream fs(_filepath, std::ofstream::binary);
52 fs.write(ptr, size);
53
54 return fs.good();
55 }
#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.


The documentation for this struct was generated from the following file: