Skip to content
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

Merged
merged 55 commits into from
Oct 14, 2020

Conversation

MingMingShangTian
Copy link
Contributor

@MingMingShangTian MingMingShangTian commented Sep 29, 2020

PR types

Others

PR changes

APIs

Describe

  1. remove and reorganize about 200 alias of APIs
  2. repair the unittests and sample codes about the changed alias APIs
  3. fix the sample codes missing paddle.enable_static() error

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@MingMingShangTian MingMingShangTian changed the title modify cond while_loop to paddle.static.nn.cond modify cond while_loop to paddle.static.nn Sep 29, 2020
…igmoid_loss, edit_distance, sampled_softmax_with_cross_entropy in nn.functional
@PaddlePaddle PaddlePaddle unlocked this conversation Oct 12, 2020
@@ -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)
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除RowConv这个类

@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改示例代码的原因是什么?

Copy link
Contributor Author

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 删除了。是否要保留?


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")
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除row_conv API

@MingMingShangTian MingMingShangTian changed the title modify cond while_loop to paddle.static.nn Remove and reorganize the alias of APIs Oct 14, 2020
@wanghaoshuang
Copy link
Contributor

paddle.fluid.layers.generate_proposal_labels 文档中的示例有问题,会导致该PR的CI失败,我会在后续PR中进行修复。

@FlyingQianMM
Copy link
Contributor

fluid.layers.deformable_roi_pooling代码有问题,会导致该PR的CI失败,我会在后续PR中进行修复。

@MingMingShangTian
Copy link
Contributor Author

paddle.sums API 问题,相关同学已经提PR了。PR 地址: #27928

XiaoguangHu01
XiaoguangHu01 previously approved these changes Oct 14, 2020
XiaoguangHu01
XiaoguangHu01 previously approved these changes Oct 14, 2020
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

raindrops2sea
raindrops2sea previously approved these changes Oct 14, 2020
@chenwhql chenwhql merged commit d05058d into PaddlePaddle:develop Oct 14, 2020
chen-zhiyu pushed a commit to chen-zhiyu/Paddle that referenced this pull request Oct 15, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants