Skip to content

Commit 5af3834

Browse files
authored
fix ipex stats bug (#1555)
Signed-off-by: xin3he <[email protected]>
1 parent 1d60f61 commit 5af3834

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

neural_compressor/adaptor/pytorch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,8 @@ def get_non_quant_modules(self, model_kwargs):
25992599
"<class 'torch.nn.modules.conv.Conv2d'>": "Conv2d",
26002600
"<class 'torch.nn.modules.conv.Conv3d'>": "Conv3d",
26012601
"<class 'torch.nn.modules.activation.ReLU'>": "ReLU",
2602-
"<method 'add' of 'torch._C._TensorBase' objects>": "add",
2602+
"<method 'add' of 'torch._C._TensorBase' objects>": "add", # for IPEX < 2.2
2603+
"<method 'add' of 'torch._C.TensorBase' objects>": "add", # for IPEX >= 2.2
26032604
"<class 'torch.nn.modules.pooling.AdaptiveAvgPool2d'>": "AdaptiveAvgPool2d",
26042605
"Linear_Relu": "Linear",
26052606
"<class 'torch.nn.modules.linear.Linear'>": "Linear",

test/algorithm/test_smooth_quant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(self):
4141
def forward(self, x):
4242
out = self.fc1(x)
4343
out = self.fc2(out)
44+
out = out + out
4445
return out
4546

4647

0 commit comments

Comments
 (0)