Skip to content

Commit 63f1e6b

Browse files
authored
Remove additional warnning in layer.to (#36700)
* 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
1 parent 5119428 commit 63f1e6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/paddle/fluid/dygraph/layers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,10 @@ def transform(t, device, dtype, blocking):
15901590

15911591
return new_t
15921592

1593-
self._apply(transform, device, dtype, blocking)
1593+
with warnings.catch_warnings():
1594+
warnings.filterwarnings("ignore", category=UserWarning)
1595+
self._apply(transform, device, dtype, blocking)
1596+
15941597
self._dtype = dtype
15951598

15961599
# [aliases] Compatible with old method names

0 commit comments

Comments
 (0)