tvm
Public Member Functions | Static Public Attributes | List of all members
tvm::meta_schedule::CostModelNode Class Referenceabstract

Cost model. More...

#include <cost_model.h>

Inheritance diagram for tvm::meta_schedule::CostModelNode:
Collaboration diagram for tvm::meta_schedule::CostModelNode:

Public Member Functions

virtual ~CostModelNode ()=default
 Virtual destructor. More...
 
virtual void Load (const String &path)=0
 Load the cost model from given file location. More...
 
virtual void Save (const String &path)=0
 Save the cost model to given file location. More...
 
virtual void Update (const TuneContext &context, const Array< MeasureCandidate > &candidates, const Array< RunnerResult > &results)=0
 Update the cost model given running results. More...
 
virtual std::vector< double > Predict (const TuneContext &context, const Array< MeasureCandidate > &candidates)=0
 Predict the normalized score (the larger the better) of given measure candidates. More...
 
 TVM_DECLARE_BASE_OBJECT_INFO (CostModelNode, Object)
 

Static Public Attributes

static constexpr const char * _type_key = "meta_schedule.CostModel"
 

Detailed Description

Cost model.

Constructor & Destructor Documentation

◆ ~CostModelNode()

virtual tvm::meta_schedule::CostModelNode::~CostModelNode ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ Load()

virtual void tvm::meta_schedule::CostModelNode::Load ( const String &  path)
pure virtual

Load the cost model from given file location.

Parameters
pathThe file path.

Implemented in tvm::meta_schedule::PyCostModelNode.

◆ Predict()

virtual std::vector<double> tvm::meta_schedule::CostModelNode::Predict ( const TuneContext context,
const Array< MeasureCandidate > &  candidates 
)
pure virtual

Predict the normalized score (the larger the better) of given measure candidates.

Parameters
contextThe tuning context.
candidatesThe measure candidates.
Returns
The predicted normalized score.

Implemented in tvm::meta_schedule::PyCostModelNode.

◆ Save()

virtual void tvm::meta_schedule::CostModelNode::Save ( const String &  path)
pure virtual

Save the cost model to given file location.

Parameters
pathThe file path.

Implemented in tvm::meta_schedule::PyCostModelNode.

◆ TVM_DECLARE_BASE_OBJECT_INFO()

tvm::meta_schedule::CostModelNode::TVM_DECLARE_BASE_OBJECT_INFO ( CostModelNode  ,
Object   
)

◆ Update()

virtual void tvm::meta_schedule::CostModelNode::Update ( const TuneContext context,
const Array< MeasureCandidate > &  candidates,
const Array< RunnerResult > &  results 
)
pure virtual

Update the cost model given running results.

Parameters
contextThe tuning context.
candidatesThe measure candidates.
resultsThe running results of the measure candidates.

Implemented in tvm::meta_schedule::PyCostModelNode.

Member Data Documentation

◆ _type_key

constexpr const char* tvm::meta_schedule::CostModelNode::_type_key = "meta_schedule.CostModel"
staticconstexpr

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