ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mpqsolver::MPQSolver Class Referenceabstract

#include <MPQSolver.h>

Public Member Functions

 MPQSolver (const core::Quantizer::Context &ctx)
 
virtual ~MPQSolver ()=default
 
virtual std::unique_ptr< luci::Modulerun (const std::string &module_path)=0
 run solver for recorded float module at module_path
 
void setSaveIntermediate (const std::string &save_path)
 set all intermediate artifacts to be saved
 

Protected Member Functions

std::unique_ptr< luci::ModulereadModule (const std::string &path)
 

Protected Attributes

std::string _input_quantization
 
std::string _output_quantization
 
std::unique_ptr< core::Quantizer_quantizer
 
std::unique_ptr< core::DumpingHooks_hooks
 

Detailed Description

Definition at line 31 of file MPQSolver.h.

Constructor & Destructor Documentation

◆ MPQSolver()

MPQSolver::MPQSolver ( const core::Quantizer::Context ctx)

Definition at line 24 of file MPQSolver.cpp.

25{
26 _quantizer = std::make_unique<core::Quantizer>(ctx);
27}
std::unique_ptr< core::Quantizer > _quantizer
Definition MPQSolver.h:54

References _quantizer.

◆ ~MPQSolver()

virtual mpqsolver::MPQSolver::~MPQSolver ( )
virtualdefault

Member Function Documentation

◆ readModule()

std::unique_ptr< luci::Module > MPQSolver::readModule ( const std::string &  path)
protected

Definition at line 34 of file MPQSolver.cpp.

35{
36 luci::ImporterEx importerex;
37 auto module = importerex.importVerifyModule(path);
38 if (module.get() == nullptr)
39 {
40 throw std::runtime_error("Failed to load model");
41 }
42
43 return module;
44}

◆ run()

virtual std::unique_ptr< luci::Module > mpqsolver::MPQSolver::run ( const std::string &  module_path)
pure virtual

run solver for recorded float module at module_path

Implemented in mpqsolver::bisection::BisectionSolver, and mpqsolver::pattern::PatternSolver.

◆ setSaveIntermediate()

void MPQSolver::setSaveIntermediate ( const std::string &  save_path)

set all intermediate artifacts to be saved

Definition at line 29 of file MPQSolver.cpp.

30{
31 _hooks = std::make_unique<core::DumpingHooks>(save_path, _quantizer->getContext());
32}
std::unique_ptr< core::DumpingHooks > _hooks
Definition MPQSolver.h:55

References _hooks, and _quantizer.

Field Documentation

◆ _hooks

std::unique_ptr<core::DumpingHooks> mpqsolver::MPQSolver::_hooks
protected

◆ _input_quantization

std::string mpqsolver::MPQSolver::_input_quantization
protected

Definition at line 52 of file MPQSolver.h.

◆ _output_quantization

std::string mpqsolver::MPQSolver::_output_quantization
protected

Definition at line 53 of file MPQSolver.h.

◆ _quantizer

std::unique_ptr<core::Quantizer> mpqsolver::MPQSolver::_quantizer
protected

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