1818import  paddle .nn .functional  as  F 
1919from  paddle .nn  import  Conv2D , Linear , ReLU , Sequential 
2020from  paddle .quantization  import  QuantConfig 
21+ from  paddle .quantization .base_quanter  import  BaseQuanter 
2122from  paddle .quantization .quanters  import  FakeQuanterWithAbsMaxObserver 
22- from  python .paddle .quantization .base_quanter  import  BaseQuanter 
2323
2424
2525class  LeNetDygraph (paddle .nn .Layer ):
@@ -86,9 +86,9 @@ def test_add_layer_config(self):
8686        self .q_config ._specify (self .model )
8787        self .assert_just_linear_weight_configure (self .model , self .q_config )
8888
89-     def  test_add_prefix_config (self ):
89+     def  test_add_name_config (self ):
9090        self .q_config  =  QuantConfig (activation = None , weight = None )
91-         self .q_config .add_prefix_config (
91+         self .q_config .add_name_config (
9292            [self .model .fc .full_name ()], activation = None , weight = self .quanter 
9393        )
9494        self .q_config ._specify (self .model )
@@ -110,11 +110,11 @@ def test_add_qat_layer_mapping(self):
110110            Sequential  not  in self .q_config .default_qat_layer_mapping 
111111        )
112112
113-     def  test_add_custom_leaf (self ):
113+     def  test_add_customized_leaf (self ):
114114        self .q_config  =  QuantConfig (activation = None , weight = None )
115-         self .q_config .add_custom_leaf (Sequential )
116-         self .assertTrue (Sequential  in  self .q_config .custom_leaves )
117-         self .assertTrue (self .q_config ._is_custom_leaf (self .model .fc ))
115+         self .q_config .add_customized_leaf (Sequential )
116+         self .assertTrue (Sequential  in  self .q_config .customized_leaves )
117+         self .assertTrue (self .q_config ._is_customized_leaf (self .model .fc ))
118118        self .assertTrue (self .q_config ._is_leaf (self .model .fc ))
119119        self .assertFalse (self .q_config ._is_default_leaf (self .model .fc ))
120120        self .assertFalse (self .q_config ._is_real_leaf (self .model .fc ))
@@ -124,7 +124,7 @@ def test_need_observe(self):
124124        self .q_config .add_layer_config (
125125            [self .model .fc ], activation = self .quanter , weight = self .quanter 
126126        )
127-         self .q_config .add_custom_leaf (Sequential )
127+         self .q_config .add_customized_leaf (Sequential )
128128        self .q_config ._specify (self .model )
129129        self .assertTrue (self .q_config ._has_observer_config (self .model .fc ))
130130        self .assertTrue (self .q_config ._need_observe (self .model .fc ))
0 commit comments