-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove and reorganize the alias of APIs #27717
Remove and reorganize the alias of APIs #27717
Conversation
Thanks for your contribution! |
…igmoid_loss, edit_distance, sampled_softmax_with_cross_entropy in nn.functional
python/paddle/fluid/layers/nn.py
Outdated
@@ -10861,7 +10800,7 @@ def sum(x): | |||
# and '__int64' on Windows. They both represent 64-bit integer variables. | |||
""" | |||
|
|||
return paddle.elementwise_sum(x) | |||
return paddle.tensor.math.elementwise_sum(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle.fluid.layers.elementwise_sum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle.fluid.layers.elementwise_sum 这个API不存在。elementwise_sum 的定义是在python/paddle/tensor/math.py中
@@ -102,5 +102,5 @@ def __init__(self, | |||
filter_shape, attr=param_attr, dtype=dtype) | |||
|
|||
def forward(self, input): | |||
out = F.row_conv(input, self.weight, act=self._act) | |||
out = F.extension.row_conv(input, self.weight, act=self._act) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除RowConv这个类
python/paddle/framework/io.py
Outdated
@@ -226,15 +226,15 @@ def save(obj, path): | |||
|
|||
emb = paddle.nn.Embedding(10, 10) | |||
layer_state_dict = emb.state_dict() | |||
paddle.save(layer_state_dict, "emb.pdparams") | |||
paddle.framework.io.save(layer_state_dict, "emb.pdparams") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改示例代码的原因是什么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为在paddle.framework 中删除了 save的别名,导致paddle目录下的__init__文件中的 from .framework import save 失效了。我这里就又把 paddle.save 删除了。是否要保留?
python/paddle/framework/io.py
Outdated
|
||
scheduler = paddle.optimizer.lr_scheduler.NoamLR( | ||
d_model=0.01, warmup_steps=100, verbose=True) | ||
adam = paddle.optimizer.Adam( | ||
learning_rate=scheduler, | ||
parameters=emb.parameters()) | ||
opt_state_dict = adam.state_dict() | ||
paddle.save(opt_state_dict, "adam.pdopt") | ||
paddle.framework.io.save(opt_state_dict, "adam.pdopt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改示例代码的原因是什么?
@@ -217,7 +189,7 @@ def row_conv(input, weight, act=None): | |||
with dg.guard(place): | |||
x_var = dg.to_variable(x) | |||
w_var = dg.to_variable(weight) | |||
y_var = F.row_conv(x_var, w_var) | |||
y_var = F.extension.row_conv(x_var, w_var) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除row_conv API
paddle.fluid.layers.generate_proposal_labels 文档中的示例有问题,会导致该PR的CI失败,我会在后续PR中进行修复。 |
fluid.layers.deformable_roi_pooling代码有问题,会导致该PR的CI失败,我会在后续PR中进行修复。 |
paddle.sums API 问题,相关同学已经提PR了。PR 地址: #27928 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6e50e93
* modify cond while_loop to paddle.static.nn.cond * modify crop_tensor to paddle.crop * modify Variable to paddle.static.Variable * remove nn.beam_search, nn.beam_search_decode, nn.gather_tree * remove bpr_loss, center_loss, rank_loss, smooth_l1, teacher_student_sigmoid_loss, edit_distance, sampled_softmax_with_cross_entropy in nn.functional * remove apis in nn.functional.learn_rate.py * remove pool2d, pool3d, adaptive_pool2d, adaptive_pool3d in nn.functional * remove apis in nn.functional.vision * remove erf, soft_relu in nn.functional.activation * remove apis in nn.functional.extension * remove nn.functional.rnn * remove hash from nn.functional.lod * remove row_conv from nn.functional.extension * remove one_hot, pad2d, pad_constant_like from nn.functional.common * remove nn.gather_tree, nn.BilinearTensorProduct, nn.Pool2D, nn.Pad2D * remove apis from optimizer.__init * remove tensor.creation.fill_constant * remove elementwise_mul in nn.functional.common and modify to paddle.multiply * remove tensor.stat.reduce_mean * remove reduce_all, reduce_any in tensor.logic * remove apis in tensor.math * remove apis in tensor.__init__ * remove has_inf, has_nan in tensor.search * remove apis in framework.__init__ * remove apis in paddle.__init__ * remove apis in nn.functional.__init__ * modify removed alias apis to raw api in doc and unittests * fix remove grid_sample bug * modify removed alias apis to raw api in doc and unittests * modify removed alias apis to raw api in doc and unittests * modify removed alias apis to raw api in doc and unittests * modify removed alias apis to raw api in doc and unittests * modify removed alias apis to raw api in doc and unittests * modify removed alias apis to raw api in doc and unittests * delete alias api relastions in doc * reserve paddle.compat, paddle.sysconfig * remove unittest for paddle.reduce_all, paddle.reduce_any * modify removed alias apis to raw api in doc and unittests * recover paddle.save and paddle.load * resolve conflicts * fix sample code missing paddle.enable_static() bug * fix sample code missing paddle.enable_static() bug * fix to_string sample code error
PR types
Others
PR changes
APIs
Describe