(
cls, tensor_node: torch.fx.Node, ep: ExportedProgram
)
| 347 | |
| 348 | @classmethod |
| 349 | def from_inputs( |
| 350 | cls, tensor_node: torch.fx.Node, ep: ExportedProgram |
| 351 | ) -> Optional[QuantParams]: |
| 352 | # tensor_node is quantized if it is produced by a dequant node |
| 353 | if is_dequant(tensor_node) and is_tagged_as_implicit_q_dq(tensor_node): |
| 354 | dq_input = cast(torch.fx.Node, tensor_node.args[0]) |
| 355 | if is_quant(dq_input): |
| 356 | q_input = cast(torch.fx.Node, dq_input.args[0]) |
| 357 | if is_param_node(ep, q_input): |
| 358 | return cls.from_q_dq_node(dq_input) |
| 359 | return cls.from_q_dq_node(tensor_node) |
| 360 | return None |
| 361 | |
| 362 | @classmethod |
| 363 | def from_outputs(cls, tensor_node: torch.fx.Node) -> Optional[QuantParams]: |
no test coverage detected