Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions neural_compressor/adaptor/tf_utils/graph_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ def _inference(self, model):
Args:
model(TensorflowBaseModel): input TensorflowBaseModel
"""
# ITEX optimization has broken INC calibration process.
# INC needs turn off ITEX optimization pass in calibration stage.
# TODO ITEX will provide API to replace setting environment variable.
if self.itex_mode:
os.environ["ITEX_REMAPPER"] = "0"
sess = model.sess
iter_op = model.iter_op
input_tensor = model.input_tensor
Expand Down Expand Up @@ -238,6 +243,8 @@ def check_shape(tensor, data):
feed_dict, output_tensor, self.calib_iteration)
if idx + 1 == self.calib_iteration:
break
if self.itex_mode:
os.environ["ITEX_REMAPPER"] = "1"

def _check_tf_version(self):
is_supported_version = False
Expand Down