Skip to content

Commit 6d36289

Browse files
mcr229facebook-github-bot
authored andcommitted
quant params from static inputs
Differential Revision: https://internalfb.com/D49850149 fbshipit-source-id: f8a247f83a38efde627f7d1a3da891dfaf48d8af
1 parent 17fee78 commit 6d36289

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backends/xnnpack/operators/quant_params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ def from_inputs(cls, tensor_node: torch.fx.Node) -> Optional[QuantParams]:
183183
if is_dequant(tensor_node) and TagImplicitQDqPass.is_tagged_as_implicit_q_dq(
184184
tensor_node
185185
):
186+
dq_input = cast(torch.fx.Node, tensor_node.args[0])
187+
if is_quant(dq_input):
188+
q_input = cast(torch.fx.Node, dq_input.args[0])
189+
if q_input.op == "placeholder":
190+
return cls.from_q_dq_node(dq_input)
186191
return cls.from_q_dq_node(tensor_node)
187192

188193
return None

0 commit comments

Comments
 (0)