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

[2.1 API] Enable printing deprecated warning info. #32712

Merged
merged 3 commits into from
May 6, 2021

Conversation

xiemoyuan
Copy link
Contributor

PR types

Bug fixes

PR changes

APIs

Describe

Enable printing deprecated warning info. Included:

python/paddle/dataset/cifar.py
python/paddle/dataset/conll05.py
python/paddle/dataset/flowers.py
python/paddle/dataset/imdb.py
python/paddle/dataset/imikolov.py
python/paddle/dataset/mnist.py
python/paddle/dataset/movielens.py
python/paddle/dataset/uci_housing.py
python/paddle/dataset/voc2012.py
python/paddle/dataset/wmt14.py
python/paddle/dataset/wmt16.py
python/paddle/fluid/dygraph/varbase_patch_methods.py
python/paddle/nn/__init__.py
python/paddle/nn/functional/loss.py
python/paddle/utils/deprecated.py

@paddle-bot-old
Copy link

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

XiaoguangHu01
XiaoguangHu01 previously approved these changes May 6, 2021
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

@@ -146,6 +146,7 @@
@deprecated(
since="2.0.0",
update_to="paddle.nn.funcitional.diag_embed",
level=1,
reason="diag_embed in paddle.nn will removed in future")
Copy link
Contributor

Choose a reason for hiding this comment

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

will be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks.

@@ -157,6 +158,7 @@ def diag_embed(*args):
@deprecated(
since="2.0.0",
update_to="paddle.nn.utils.remove_weight_norm",
level=1,
reason="remove_weight_norm in paddle.nn will removed in future")
Copy link
Contributor

Choose a reason for hiding this comment

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

will be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks.

@@ -168,6 +170,7 @@ def remove_weight_norm(*args):
@deprecated(
since="2.0.0",
update_to="paddle.nn.utils.weight_norm",
level=1,
reason="weight_norm in paddle.nn will removed in future")
Copy link
Contributor

Choose a reason for hiding this comment

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

will be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks.

@@ -1096,7 +1096,8 @@ def ctc_loss(log_probs,
return loss_out


@deprecated(since="2.0.0", update_to="paddle.nn.functional.cross_entropy")
@deprecated(
since="2.0.0", update_to="paddle.nn.functional.cross_entropy", level=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

是不是在reason参数里说明一下,paddle.nn.functional.cross_entropysoftmax_with_cross_entropy的行为是不一致的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks.

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

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

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

lgtm

@XiaoguangHu01 XiaoguangHu01 merged commit 51b39a9 into PaddlePaddle:develop May 6, 2021
@xiemoyuan xiemoyuan deleted the Optimize-deprecated branch May 6, 2021 11:19
xiemoyuan added a commit to xiemoyuan/Paddle that referenced this pull request May 6, 2021
* Add deprecated warning info.

* Add unittest for deprecated decorator.

* Add warning info for tensor.grad
XiaoguangHu01 pushed a commit that referenced this pull request May 7, 2021
* Add deprecated warning info.

* Add unittest for deprecated decorator.

* Add warning info for tensor.grad
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.

3 participants