From 0bf10c913cf02fe5d7d87cb00a52b280436873d6 Mon Sep 17 00:00:00 2001 From: whs Date: Wed, 14 Jun 2023 10:11:46 +0800 Subject: [PATCH] Change in_dygraph_mode to in_dynamic_mode (#1764) --- paddleslim/nas/ofa/layers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddleslim/nas/ofa/layers.py b/paddleslim/nas/ofa/layers.py index f8edd9aa..1477b807 100644 --- a/paddleslim/nas/ofa/layers.py +++ b/paddleslim/nas/ofa/layers.py @@ -20,7 +20,6 @@ import paddle from ...common import get_logger from .utils.utils import compute_start_end, get_same_padding, convert_to_list from .layers_base import * -from paddle.framework import in_dygraph_mode __all__ = [ 'SuperConv2D', 'SuperConv2DTranspose', 'SuperSeparableConv2D', @@ -985,7 +984,7 @@ class SuperBatchNorm2D(paddle.nn.BatchNorm2D): "use_global_stats", self._use_global_stats, "trainable_statistics", trainable_statistics) - if in_dygraph_mode(): + if paddle.in_dynamic_mode(): paddle_compile = os.environ.get("paddle_compile") if feature_dim != self._mean.shape[0]: if not paddle_compile or "Develop" in paddle_compile: -- GitLab