File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
python/paddle/v2/framework/tests Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1717optimize_net = core .Net .create ()
1818
1919
20- def atom_id ():
20+ def atomic_id ():
2121 id = 0
2222 while True :
2323 yield id
2424 id += 1
2525
2626
27- uniq_id = atom_id ().next
27+ uniq_id = atomic_id ().next
2828
2929
3030def data_layer (name , dims ):
@@ -164,7 +164,7 @@ def set_cost(cost):
164164 cost_grad .set (numpy .ones (cost_shape ).astype ("float32" ), place )
165165
166166
167- def mean_cost (cost ):
167+ def get_cost_mean (cost ):
168168 cost_data = numpy .array (scope .find_var (cost ).get_tensor ())
169169 return cost_data .sum () / len (cost_data )
170170
@@ -217,7 +217,7 @@ def test(cost_name):
217217
218218 forward_net .infer_shape (scope )
219219 forward_net .run (scope , dev_ctx )
220- cost .append (mean_cost (cost_name ))
220+ cost .append (get_cost_mean (cost_name ))
221221 error .append (error_rate (predict , "label" ))
222222 print ("cost=" + str (sum (cost ) / float (len (cost ))) + " error_rate=" + str (
223223 sum (error ) / float (len (error ))))
You can’t perform that action at this time.
0 commit comments