@@ -8,24 +8,18 @@ pub struct GraphCodec<T> {
88 template : GraphChromosome < T > ,
99}
1010
11- impl < T > GraphCodec < T > {
11+ impl < T : Clone + Default > GraphCodec < T > {
1212 pub fn new (
1313 template : impl IntoIterator < Item = GraphNode < T > > ,
1414 store : impl Into < NodeStore < T > > ,
15- ) -> Self
16- where
17- T : Clone + Default ,
18- {
15+ ) -> Self {
1916 GraphCodec {
2017 store : store. into ( ) ,
2118 template : template. into_iter ( ) . collect ( ) ,
2219 }
2320 }
2421
25- pub fn directed ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self
26- where
27- T : Clone + Default ,
28- {
22+ pub fn directed ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self {
2923 let new_store = store. into ( ) ;
3024
3125 GraphCodec {
@@ -36,10 +30,11 @@ impl<T> GraphCodec<T> {
3630 }
3731 }
3832
39- pub fn recurrent ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self
40- where
41- T : Clone + Default ,
42- {
33+ pub fn recurrent (
34+ input_size : usize ,
35+ output_size : usize ,
36+ store : impl Into < NodeStore < T > > ,
37+ ) -> Self {
4338 let new_store = store. into ( ) ;
4439
4540 GraphCodec {
@@ -54,10 +49,7 @@ impl<T> GraphCodec<T> {
5449 input_size : usize ,
5550 output_size : usize ,
5651 store : impl Into < NodeStore < T > > ,
57- ) -> Self
58- where
59- T : Clone + Default ,
60- {
52+ ) -> Self {
6153 let new_store = store. into ( ) ;
6254
6355 GraphCodec {
@@ -72,10 +64,7 @@ impl<T> GraphCodec<T> {
7264 input_size : usize ,
7365 output_size : usize ,
7466 store : impl Into < NodeStore < T > > ,
75- ) -> Self
76- where
77- T : Clone + Default ,
78- {
67+ ) -> Self {
7968 let new_store = store. into ( ) ;
8069
8170 GraphCodec {
@@ -86,10 +75,7 @@ impl<T> GraphCodec<T> {
8675 }
8776 }
8877
89- pub fn lstm ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self
90- where
91- T : Clone + Default ,
92- {
78+ pub fn lstm ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self {
9379 let new_store = store. into ( ) ;
9480
9581 GraphCodec {
@@ -100,10 +86,7 @@ impl<T> GraphCodec<T> {
10086 }
10187 }
10288
103- pub fn gru ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self
104- where
105- T : Clone + Default ,
106- {
89+ pub fn gru ( input_size : usize , output_size : usize , store : impl Into < NodeStore < T > > ) -> Self {
10790 let new_store = store. into ( ) ;
10891
10992 GraphCodec {
@@ -120,10 +103,7 @@ impl<T> GraphCodec<T> {
120103 rows : usize ,
121104 cols : usize ,
122105 store : impl Into < NodeStore < T > > ,
123- ) -> Self
124- where
125- T : Clone + Default ,
126- {
106+ ) -> Self {
127107 let new_store = store. into ( ) ;
128108
129109 GraphCodec {
0 commit comments