@@ -59,13 +59,13 @@ def test_pooling_layer(self):
59
59
num_channels = 16 ,
60
60
pool_type = pooling .Max ())
61
61
maxout = layer .maxout (input = conv , num_channels = 16 , groups = 4 )
62
- print layer .parse_network (maxpool , spp , maxout )
62
+ print layer .parse_network ([ maxpool , spp , maxout ] )
63
63
64
64
def test_norm_layer (self ):
65
65
norm1 = layer .img_cmrnorm (input = conv , size = 5 )
66
66
norm2 = layer .batch_norm (input = conv )
67
67
norm3 = layer .sum_to_one_norm (input = conv )
68
- print layer .parse_network (norm1 , norm2 , norm3 )
68
+ print layer .parse_network ([ norm1 , norm2 , norm3 ] )
69
69
70
70
71
71
class AggregateLayerTest (unittest .TestCase ):
@@ -78,7 +78,8 @@ def test_aggregate_layer(self):
78
78
first_seq = layer .first_seq (input = pixel )
79
79
concat = layer .concat (input = [last_seq , first_seq ])
80
80
seq_concat = layer .seq_concat (a = last_seq , b = first_seq )
81
- print layer .parse_network (pool , last_seq , first_seq , concat , seq_concat )
81
+ print layer .parse_network (
82
+ [pool , last_seq , first_seq , concat , seq_concat ])
82
83
83
84
84
85
class MathLayerTest (unittest .TestCase ):
@@ -95,8 +96,10 @@ def test_math_layer(self):
95
96
tensor = layer .tensor (a = pixel , b = pixel , size = 1000 )
96
97
cos_sim = layer .cos_sim (a = pixel , b = pixel )
97
98
trans = layer .trans (input = tensor )
98
- print layer .parse_network (addto , linear_comb , interpolation , power ,
99
- scaling , slope , tensor , cos_sim , trans )
99
+ print layer .parse_network ([
100
+ addto , linear_comb , interpolation , power , scaling , slope , tensor ,
101
+ cos_sim , trans
102
+ ])
100
103
101
104
102
105
class ReshapeLayerTest (unittest .TestCase ):
@@ -110,7 +113,8 @@ def test_reshape_layer(self):
110
113
repeat = layer .repeat (input = pixel , num_repeats = 4 )
111
114
reshape = layer .seq_reshape (input = pixel , reshape_size = 4 )
112
115
rotate = layer .rotate (input = pixel , height = 16 , width = 49 )
113
- print layer .parse_network (block_expand , expand , repeat , reshape , rotate )
116
+ print layer .parse_network (
117
+ [block_expand , expand , repeat , reshape , rotate ])
114
118
115
119
116
120
class RecurrentLayerTest (unittest .TestCase ):
@@ -119,7 +123,7 @@ def test_recurrent_layer(self):
119
123
recurrent = layer .recurrent (input = word )
120
124
lstm = layer .lstmemory (input = word )
121
125
gru = layer .grumemory (input = word )
122
- print layer .parse_network (recurrent , lstm , gru )
126
+ print layer .parse_network ([ recurrent , lstm , gru ] )
123
127
124
128
125
129
class CostLayerTest (unittest .TestCase ):
@@ -139,10 +143,10 @@ def test_cost_layer(self):
139
143
cost10 = layer .sum_cost (input = inference )
140
144
cost11 = layer .huber_cost (input = score , label = label )
141
145
142
- print layer .parse_network (cost1 , cost2 )
143
- print layer .parse_network (cost3 , cost4 )
144
- print layer .parse_network (cost5 , cost6 )
145
- print layer .parse_network (cost7 , cost8 , cost9 , cost10 , cost11 )
146
+ print layer .parse_network ([ cost1 , cost2 ] )
147
+ print layer .parse_network ([ cost3 , cost4 ] )
148
+ print layer .parse_network ([ cost5 , cost6 ] )
149
+ print layer .parse_network ([ cost7 , cost8 , cost9 , cost10 , cost11 ] )
146
150
147
151
crf = layer .crf (input = inference , label = label )
148
152
crf_decoding = layer .crf_decoding (input = inference , size = 3 )
@@ -151,16 +155,16 @@ def test_cost_layer(self):
151
155
nce = layer .nce (input = inference , label = label , num_classes = 3 )
152
156
hsigmoid = layer .hsigmoid (input = inference , label = label , num_classes = 3 )
153
157
154
- print layer .parse_network (crf , crf_decoding , ctc , warp_ctc , nce ,
155
- hsigmoid )
158
+ print layer .parse_network (
159
+ [ crf , crf_decoding , ctc , warp_ctc , nce , hsigmoid ] )
156
160
157
161
158
162
class OtherLayerTest (unittest .TestCase ):
159
163
def test_sampling_layer (self ):
160
164
maxid = layer .max_id (input = inference )
161
165
sampling_id = layer .sampling_id (input = inference )
162
166
eos = layer .eos (input = maxid , eos_id = 5 )
163
- print layer .parse_network (maxid , sampling_id , eos )
167
+ print layer .parse_network ([ maxid , sampling_id , eos ] )
164
168
165
169
def test_slicing_joining_layer (self ):
166
170
pad = layer .pad (input = conv , pad_c = [2 , 3 ], pad_h = [1 , 2 ], pad_w = [3 , 1 ])
0 commit comments