File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
neural_compressor/adaptor/tf_utils Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ def _inference(self, model):
160160 Args:
161161 model(TensorflowBaseModel): input TensorflowBaseModel
162162 """
163+ # ITEX optimization has broken INC calibration process.
164+ # INC needs turn off ITEX optimization pass in calibration stage.
165+ # TODO ITEX will provide API to replace setting environment variable.
166+ if self .itex_mode :
167+ os .environ ["ITEX_REMAPPER" ] = "0"
163168 sess = model .sess
164169 iter_op = model .iter_op
165170 input_tensor = model .input_tensor
@@ -238,6 +243,8 @@ def check_shape(tensor, data):
238243 feed_dict , output_tensor , self .calib_iteration )
239244 if idx + 1 == self .calib_iteration :
240245 break
246+ if self .itex_mode :
247+ os .environ ["ITEX_REMAPPER" ] = "1"
241248
242249 def _check_tf_version (self ):
243250 is_supported_version = False
You can’t perform that action at this time.
0 commit comments