Skip to content

Commit

Permalink
Remove additional warnning in layer.to (#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 Oct 26, 2021
1 parent 5119428 commit 63f1e6b
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 @@ -1590,7 +1590,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 63f1e6b

Please sign in to comment.