Skip to content

Commit

Permalink
[fix] tengine output getitem bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyang authored and Tracin committed Sep 21, 2022
1 parent 8cc2477 commit 835b48e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mqbench/custom_quantizer/tengine_u8_quantizer.py
@@ -1,5 +1,6 @@
import torch
from torch.fx import GraphModule
import operator

from mqbench.utils.registry import register_model_quantizer
from mqbench.utils import getitem2node
Expand Down Expand Up @@ -72,6 +73,8 @@ def _find_act_quants(self, model: GraphModule) -> list:
elif node.op == "output":
for _arg in node.args:
if isinstance(_arg, torch.fx.node.Node):
if _arg.target == operator.getitem:
continue
if _arg.op == 'placeholder':
continue
node_need_to_quantize_output.append(_arg)
Expand Down

0 comments on commit 835b48e

Please sign in to comment.