diff --git a/python/paddle/fluid/dygraph/layers.py b/python/paddle/fluid/dygraph/layers.py index 694f9dc25e80c53c9b3fc916053ba4f91858d251..e1855ee6db9af8e3f1d560563ceaa264ed28e355 100644 --- a/python/paddle/fluid/dygraph/layers.py +++ b/python/paddle/fluid/dygraph/layers.py @@ -1590,7 +1590,10 @@ class Layer(core.Layer): 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