Skip to main content

serialize_policy

Function serialize_policy 

Source
pub fn serialize_policy<B, P>(policy: &P) -> Result<Vec<u8>>
Expand description

Serialize the learner policy’s autodiff-stripped (valid()) view to bytes for broadcasting.

Uses burn::record::BinBytesRecorder with burn::record::FullPrecisionSettings, so the blob loads on any backend with matching element types via load_policy_from_broadcast.

§Errors

Returns an error when the recorder fails to encode the record.