Vowpal Wabbit
|
#include <model_parser.h>
Public Member Functions | |
model_parser (const char *model, size_t length) | |
int | read (const char *field_name, size_t field_length, const char **ret) |
int | skip (size_t bytes) |
const char * | position () |
uint32_t | checksum () |
template<bool compute_checksum> | |
int | read_string (const char *field_name, std::string &s) |
template<typename T , bool compute_checksum> | |
int | read (const char *field_name, T &val) |
template<typename T > | |
int | read (const char *field_name, T &val) |
template<typename T , typename W > | |
int | read_weights (std::unique_ptr< W > &weights, uint64_t weight_length) |
template<typename W > | |
int | read_weights (std::unique_ptr< W > &weights, uint32_t num_bits, uint32_t stride_shift) |
Private Attributes | |
const char * | _model_begin |
const char * | _model |
const char * | _model_end |
uint32_t | _checksum |
Definition at line 20 of file model_parser.h.
vw_slim::model_parser::model_parser | ( | const char * | model, |
size_t | length | ||
) |
uint32_t vw_slim::model_parser::checksum | ( | ) |
Definition at line 17 of file model_parser.cc.
References _checksum.
Referenced by vw_slim::vw_predict< W >::load().
const char * vw_slim::model_parser::position | ( | ) |
int vw_slim::model_parser::read | ( | const char * | field_name, |
size_t | field_length, | ||
const char ** | ret | ||
) |
Definition at line 19 of file model_parser.cc.
References _model, _model_end, E_VW_PREDICT_ERR_INVALID_MODEL, and S_VW_PREDICT_OK.
Referenced by vw_slim::vw_predict< W >::load(), read(), and read_string().
|
inline |
Definition at line 73 of file model_parser.h.
References _checksum, _model_begin, read(), RETURN_ON_FAIL, S_VW_PREDICT_OK, and uniform_hash().
|
inline |
Definition at line 100 of file model_parser.h.
|
inline |
Definition at line 39 of file model_parser.h.
References E_VW_PREDICT_ERR_INVALID_MODEL, read(), RETURN_ON_FAIL, S_VW_PREDICT_OK, and uniform_hash().
Referenced by vw_slim::vw_predict< W >::load().
|
inline |
Definition at line 106 of file model_parser.h.
References E_VW_PREDICT_ERR_WEIGHT_INDEX_OUT_OF_RANGE, RETURN_ON_FAIL, and S_VW_PREDICT_OK.
Referenced by vw_slim::vw_predict< W >::load().
|
inline |
Definition at line 128 of file model_parser.h.
References RETURN_ON_FAIL, and S_VW_PREDICT_OK.
int vw_slim::model_parser::skip | ( | size_t | bytes | ) |
Definition at line 37 of file model_parser.cc.
References _checksum, _model, _model_end, E_VW_PREDICT_ERR_INVALID_MODEL, S_VW_PREDICT_OK, and uniform_hash().
Referenced by vw_slim::vw_predict< W >::load().
|
private |
Definition at line 25 of file model_parser.h.
Referenced by checksum(), read(), and skip().
|
private |
Definition at line 23 of file model_parser.h.
Referenced by position(), read(), and skip().
|
private |
Definition at line 22 of file model_parser.h.
Referenced by model_parser(), and read().
|
private |
Definition at line 24 of file model_parser.h.
Referenced by model_parser(), read(), and skip().