io-chess
UCI chess engine
Loading...
Searching...
No Matches
export Namespace Reference

Classes

class  OnnxWrapper
class  OnnxBackboneWrapper
class  OnnxExpertWrapper

Functions

Dict[str, torch.Tensor] _extract_state_dict (object ckpt_obj)
 _write_u32s (f, values)
 _write_f32_array (f, np.ndarray arr)
None export_native_weights (Path out_path, ChessNetFactorizedMoE model)
None export_inputs_and_refs (Path inputs_path, Path refs_path, ChessNetFactorizedMoE model, int n_samples, int seed)
None main ()

Variables

int MAGIC_WEIGHTS = 0x32454F4D
int MAGIC_INPUTS = 0x32504E49
int MAGIC_REFS = 0x32464552
int VERSION = 1
int MAX_BRANCH_PLANES = 10
dict POOL_TO_CODE

Detailed Description

@file export.py
@brief Export parity artifacts for training/model.py

1) Native float32 weights for a C++ loader
2) ONNX models (monolithic + split backbone/experts)
3) Deterministic input samples and PyTorch reference outputs

Function Documentation

◆ _extract_state_dict()

Dict[str, torch.Tensor] _extract_state_dict ( object ckpt_obj)
protected
Here is the caller graph for this function:

◆ _write_f32_array()

_write_f32_array ( f,
np.ndarray arr )
protected
Here is the caller graph for this function:

◆ _write_u32s()

_write_u32s ( f,
values )
protected
Here is the caller graph for this function:

◆ export_inputs_and_refs()

None export_inputs_and_refs ( Path inputs_path,
Path refs_path,
ChessNetFactorizedMoE model,
int n_samples,
int seed )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ export_native_weights()

None export_native_weights ( Path out_path,
ChessNetFactorizedMoE model )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

None main ( )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MAGIC_INPUTS

int export.MAGIC_INPUTS = 0x32504E49

◆ MAGIC_REFS

int export.MAGIC_REFS = 0x32464552

◆ MAGIC_WEIGHTS

int export.MAGIC_WEIGHTS = 0x32454F4D

◆ MAX_BRANCH_PLANES

int export.MAX_BRANCH_PLANES = 10

◆ POOL_TO_CODE

dict export.POOL_TO_CODE
Initial value:
= {
"flat": 0,
"gap": 1,
"pool2avg": 2,
"pool2max": 3,
}

◆ VERSION

int export.VERSION = 1