Skip to content

Commit 67bd4cd

Browse files
author
chengduo
authored
Merge pull request #5802 from chengduoZH/reorder_parameter
reorder parameters of layer
2 parents f04c97a + 7177c27 commit 67bd4cd

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

python/paddle/v2/fluid/layers.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
def fc(input,
1919
size,
20+
num_flatten_dims=1,
2021
param_attr=None,
2122
param_initializer=None,
2223
bias_attr=None,
2324
bias_initializer=None,
24-
name=None,
2525
act=None,
26-
num_flatten_dims=1,
26+
name=None,
2727
main_program=None,
2828
startup_program=None):
2929
"""
@@ -32,15 +32,15 @@ def fc(input,
3232
Args:
3333
input: The input tensor to the function
3434
size: The size of the layer
35+
num_flatten_dims: Number of columns in input
3536
param_attr: The parameters/weights to the FC Layer
3637
param_initializer: Initializer used for the weight/parameter.
3738
If None, XavierInitializer() is used
3839
bias_attr: The bias parameter for the FC layer
3940
bias_initializer: Initializer used for the bias.
4041
If None, then ConstantInitializer() is used
41-
name: Name/alias of the function
4242
act: Activation to be applied to the output of FC layer
43-
num_flatten_dims: Number of columns in input
43+
name: Name/alias of the function
4444
main_program: Name of the main program that calls this
4545
startup_program: Name of the startup program
4646
@@ -111,9 +111,9 @@ def _get_default_bias_initializer():
111111

112112
def embedding(input,
113113
size,
114-
data_type='float32',
115114
is_sparse=False,
116115
param_attr=None,
116+
data_type='float32',
117117
main_program=None,
118118
startup_program=None):
119119
"""
@@ -122,9 +122,9 @@ def embedding(input,
122122
Args:
123123
input: The input to the function
124124
size: The size of the layer
125-
data_type: The type of data : float32, float_16, int etc
126125
is_sparse: A flag that decleares whether the input is sparse
127126
param_attr: Parameters for this layer
127+
data_type: The type of data : float32, float_16, int etc
128128
main_program: Name of the main program that calls this
129129
startup_program: Name of the startup program
130130
@@ -152,14 +152,14 @@ def embedding(input,
152152
# TODO(qijun): expose H0 and C0
153153
def dynamic_lstm(input,
154154
size,
155-
data_type='float32',
156155
param_attr=None,
157156
bias_attr=None,
158157
use_peepholes=True,
159158
is_reverse=False,
160159
gate_activation='sigmoid',
161160
cell_activation='tanh',
162161
candidate_activation='tanh',
162+
data_type='float32',
163163
main_program=None,
164164
startup_program=None):
165165
helper = LayerHelper('lstm', **locals())
@@ -200,9 +200,9 @@ def dynamic_lstm(input,
200200

201201
def data(name,
202202
shape,
203+
append_batch_size=True,
203204
data_type='float32',
204205
type=core.VarDesc.VarType.LOD_TENSOR,
205-
append_batch_size=True,
206206
main_program=None,
207207
startup_program=None,
208208
stop_gradient=True):
@@ -212,9 +212,9 @@ def data(name,
212212
Args:
213213
name: The name/alias of the function
214214
shape: Tuple declaring the shape.
215+
append_batch_size: Whether or not to append the data as a batch.
215216
data_type: The type of data : float32, float_16, int etc
216217
type: The output type. By default it is LOD_TENSOR.
217-
append_batch_size: Whether or not to append the data as a batch.
218218
main_program: Name of the main program that calls this
219219
startup_program: Name of the startup program
220220
stop_gradient: A boolean that mentions whether gradient should flow.
@@ -600,12 +600,12 @@ def sequence_conv(input,
600600
num_filters,
601601
filter_size=3,
602602
filter_stride=1,
603-
act=None,
604603
padding=None,
605604
bias_attr=None,
606605
bias_initializer=None,
607606
param_attr=None,
608607
param_initializer=None,
608+
act=None,
609609
main_program=None,
610610
startup_program=None):
611611
"""
@@ -658,16 +658,16 @@ def _get_default_param_initializer():
658658

659659
def conv2d(input,
660660
num_filters,
661-
name=None,
662-
filter_size=[1, 1],
663-
act=None,
664-
groups=None,
661+
filter_size,
665662
stride=[1, 1],
666663
padding=None,
667-
bias_attr=None,
668-
bias_initializer=None,
664+
groups=None,
669665
param_attr=None,
670666
param_initializer=None,
667+
bias_attr=None,
668+
bias_initializer=None,
669+
act=None,
670+
name=None,
671671
main_program=None,
672672
startup_program=None):
673673
"""

0 commit comments

Comments
 (0)