paddle.fluid.layers. 下面的api函数接口 不太一致
举个例子 paddle.fluid.layers.data paddle.fluid.layers.embedding paddle.fluid.layers.fc
三个定义接口定义如下,其中data 的name参数在最前面没有缺省值,embedding 没有name参数,fc有name参数放在最后,而且缺省值是None
def data(name,
shape,
append_batch_size=True,
dtype='float32',
lod_level=0,
type=core.VarDesc.VarType.LOD_TENSOR,
stop_gradient=True):
def embedding(input,
size,
is_sparse=False,
padding_idx=None,
param_attr=None,
dtype='float32'):
def fc(input,
size,
num_flatten_dims=1,
param_attr=None,
bias_attr=None,
use_mkldnn=False,
act=None,
is_test=False,
name=None):
您好,此issue在近一个月内暂无更新,我们将于今天内关闭。若在关闭后您仍需跟进提问,可重新开启此问题,我们将在24小时内回复您。因关闭带来的不便我们深表歉意,请您谅解~感谢您对PaddlePaddle的支持! Hello, this issue has not been updated in the past month. We will close it today for the sake of other user‘s experience. If you still need to follow up on this question after closing, please feel free to reopen it. In that case, we will get back to you within 24 hours. We apologize for the inconvenience caused by the closure and thank you so much for your support of PaddlePaddle Group!
历史上的确有一些api的实现没有经过严格api review,1.0之后api需要通过少数人review,一致性会有所加强。已经公开的api的修改需要考虑已有用户的兼容性,所以不会随便修改,embedding可以考虑加一个name=None