pub fn serialize_policy<B, P>(policy: &P) -> Result<Vec<u8>>where
B: AutodiffBackend,
P: AutodiffModule<B>,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.