io-chess
UCI chess engine
Loading...
Searching...
No Matches
ExpertWeightsWriter Class Reference

#include <Writers.hpp>

Public Member Functions

 ExpertWeightsWriter (const std::string &fname, size_t batch_capacity=1000)
 ~ExpertWeightsWriter ()
void add (const ExpertRouter::ExpertWeights &weights)
void add (const float *weights)
void flush ()

Private Attributes

std::string filename
std::vector< float > buffer
size_t batch_size

Static Private Attributes

static constexpr int NUM_EXPERTS = ExpertRouter::NUM_EXPERTS

Detailed Description

ExpertWeightsWriter - Writes expert routing weights during preprocessing

Output format: 6 x float32 per position (NUM_EXPERTS weights) Total: 24 bytes per position

Constructor & Destructor Documentation

◆ ExpertWeightsWriter()

ExpertWeightsWriter::ExpertWeightsWriter ( const std::string & fname,
size_t batch_capacity = 1000 )

◆ ~ExpertWeightsWriter()

ExpertWeightsWriter::~ExpertWeightsWriter ( )
Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

void ExpertWeightsWriter::add ( const ExpertRouter::ExpertWeights & weights)

Add weights for one position

Parameters
weightsThe ExpertWeights struct from ExpertRouter
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [2/2]

void ExpertWeightsWriter::add ( const float * weights)

Add weights from raw array

Parameters
weightsArray of NUM_EXPERTS floats
Here is the call graph for this function:

◆ flush()

void ExpertWeightsWriter::flush ( )
Here is the caller graph for this function:

Member Data Documentation

◆ batch_size

size_t ExpertWeightsWriter::batch_size
private

◆ buffer

std::vector<float> ExpertWeightsWriter::buffer
private

◆ filename

std::string ExpertWeightsWriter::filename
private

◆ NUM_EXPERTS

int ExpertWeightsWriter::NUM_EXPERTS = ExpertRouter::NUM_EXPERTS
staticconstexprprivate

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