Skip to content

Commit

Permalink
only filter DeprecationWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius84 committed Sep 5, 2022
1 parent 154dc75 commit 3ddaaa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/paddle/fluid/dygraph/dygraph_to_static/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def _inject_import_statements():
"import paddle", "from paddle import Tensor",
"import paddle.fluid as fluid", "import paddle.jit.dy2static as _jst",
"from typing import *", "import numpy as np", "import warnings",
"warnings.filterwarnings('ignore')"
"warnings.filterwarnings('ignore', category=DeprecationWarning)"
]
return '\n'.join(import_statements) + '\n'

Expand Down
3 changes: 2 additions & 1 deletion python/paddle/fluid/layers/math_op_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ def __impl__(self, other_var):
"If your code works well in the older versions but crashes in this version, try to use "
"%s(X, Y, axis=0) instead of %s. This transitional warning will be dropped in the future."
% (file_name, line_num, EXPRESSION_MAP[method_name],
op_type, op_type, EXPRESSION_MAP[method_name]))
op_type, op_type, EXPRESSION_MAP[method_name]),
category=DeprecationWarning)
current_block(self).append_op(type=op_type,
inputs={
'X': [self],
Expand Down

0 comments on commit 3ddaaa1

Please sign in to comment.