6 use serde::{Serialize, Deserialize}; |
6 use serde::{Serialize, Deserialize}; |
7 use serde::ser::{Serializer, SerializeStruct}; |
7 use serde::ser::{Serializer, SerializeStruct}; |
8 use alg_tools::types::*; |
8 use alg_tools::types::*; |
9 |
9 |
10 /// Wrapper for [`Normal`] that can be serialized by serde. |
10 /// Wrapper for [`Normal`] that can be serialized by serde. |
|
11 #[derive(Debug)] |
11 pub struct SerializableNormal<T : Float>(Normal<T>) |
12 pub struct SerializableNormal<T : Float>(Normal<T>) |
12 where StandardNormal : Distribution<T>; |
13 where StandardNormal : Distribution<T>; |
13 |
14 |
14 impl<T : Float> Distribution<T> for SerializableNormal<T> |
15 impl<T : Float> Distribution<T> for SerializableNormal<T> |
15 where StandardNormal : Distribution<T> { |
16 where StandardNormal : Distribution<T> { |