blace.ai
blace::computation_graph::GraphEvaluator Class Reference

#include <graph_evaluator.h>

Public Member Functions

 GraphEvaluator (blace::ops::OpP node)
 
 GraphEvaluator (std::shared_ptr< NodeOp > node)
 
void to_dot_file (const std::filesystem::path &filename)
 
std::string to_dot_string ()
 
std::optional< std::string > evaluateToString ()
 
std::optional< std::vector< int64_t > > evaluateToIntList ()
 
std::optional< RawMemoryObjectevaluateToRawMemory (std::shared_ptr< ml_core::ProgressCallback > progress_callback=nullptr)
 

Detailed Description

A class to evaluate constructed graphs.

Constructor & Destructor Documentation

◆ GraphEvaluator() [1/2]

blace::computation_graph::GraphEvaluator::GraphEvaluator ( blace::ops::OpP  node)

Constructs a graph evaluator instance from a node.

Parameters
nodeThe final node which shall be evaluated.

◆ GraphEvaluator() [2/2]

blace::computation_graph::GraphEvaluator::GraphEvaluator ( std::shared_ptr< NodeOp >  node)

Constructs a graph evaluator instance from a internal node.

Parameters
nodeThe final node which shall be evaluated.

Member Function Documentation

◆ evaluateToIntList()

std::optional< std::vector< int64_t > > blace::computation_graph::GraphEvaluator::evaluateToIntList ( )

Evaluates graph to an integer list.

Returns
std::vector<int64_t> result or std::nullopt in case of error.

◆ evaluateToRawMemory()

std::optional< RawMemoryObject > blace::computation_graph::GraphEvaluator::evaluateToRawMemory ( std::shared_ptr< ml_core::ProgressCallback >  progress_callback = nullptr)

Evaluates graph to raw memory.

Returns
RawMemoryObject result or std::nullopt in case of error.

◆ evaluateToString()

std::optional< std::string > blace::computation_graph::GraphEvaluator::evaluateToString ( )

Evaluates graph to string.

Returns
std::string result or std::nullopt in case of error.

◆ to_dot_file()

void blace::computation_graph::GraphEvaluator::to_dot_file ( const std::filesystem::path &  filename)

Writes a .dot file with the graph structure.

Parameters
filename

◆ to_dot_string()

std::string blace::computation_graph::GraphEvaluator::to_dot_string ( )

Returns a .dot string with the graph structure.

Parameters
filename