File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ def set_default_bias_initializer(self):
3636 def to_attr (arg ):
3737 if arg is None :
3838 return ParamAttr ()
39+ elif isinstance (arg , list ) or isinstance (arg , tuple ):
40+ return [ParamAttr .to_attr (a ) for a in arg ]
3941 elif isinstance (arg , ParamAttr ):
4042 return arg
4143 elif isinstance (arg , str ) or isinstance (arg , unicode ):
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ def test_recognize_digits_mlp(self):
2929 label = layers .data (name = 'label' , shape = [1 ], dtype = 'int32' )
3030 hidden1 = layers .fc (input = images , size = 128 , act = 'relu' )
3131 hidden2 = layers .fc (input = hidden1 , size = 64 , act = 'relu' )
32- predict = layers .fc (input = hidden2 , size = 10 , act = 'softmax' )
32+ predict = layers .fc (input = [hidden2 , hidden1 ],
33+ size = 10 ,
34+ act = 'softmax' ,
35+ param_attr = ["sftmax.w1" , "sftmax.w2" ])
3336 cost = layers .cross_entropy (input = predict , label = label )
3437 avg_cost = layers .mean (x = cost )
3538 self .assertIsNotNone (avg_cost )
You can’t perform that action at this time.
0 commit comments