[Discuss] How should we define the order of parameters in the new Op[python interface]?
Created by: chengduoZH
I think we should consider how to define the order of the parameters of the new Op. Here's the order of the parameters of the conv2d, and I don't think it's a good order.
def conv2d(input,
num_filters,
name=None,
filter_size=[1, 1],
act=None,
groups=None,
stride=[1, 1],
padding=None,
bias_attr=None,
param_attr=None,
main_program=None,
startup_program=None)
Here is the order of the parameters I think are better.
def conv2d(
input,
num_filters,
filter_size=[1, 1],
stride=[1, 1],
padding=None,
groups=None,
param_attr=None,
bias_attr=None,
act=None,
name=None,
main_program=None,
startup_program=None):
Parameter order:
- Input Variable.
- Op common parameters: num_filters, filter_size, strides, paddings, groups.
- parameter name and parameter initialization method (param_attr, bias_attr).
- active.
- name.
- main_program and startup_program.
What do you think of it? @jacquesqiao @dzhwinter @reyoung @qingqing01