Skip to content

Commit

Permalink
Remove additional warnning in layer.to (PaddlePaddle#36700)
Browse files Browse the repository at this point in the history
* remove additional warnning in layer.to

* remove additional warnning in layer.to

* remove additional warnning in layer.to

* remove additional warnning in layer.to

* remove additional warnning in layer.to
  • Loading branch information
JiabinYang authored and zhangbo9674 committed Dec 12, 2021
1 parent 0e5846c commit 721e78c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/paddle/fluid/dygraph/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,10 @@ def transform(t, device, dtype, blocking):

return new_t

self._apply(transform, device, dtype, blocking)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
self._apply(transform, device, dtype, blocking)

self._dtype = dtype

# [aliases] Compatible with old method names
Expand Down

0 comments on commit 721e78c

Please sign in to comment.