MCPcopy Create free account
hub / github.com/pytorch/executorch / from_inputs

Method from_inputs

backends/xnnpack/operators/quant_params.py:349–360  ·  view source on GitHub ↗
(
        cls, tensor_node: torch.fx.Node, ep: ExportedProgram
    )

Source from the content-addressed store, hash-verified

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]:

Callers 8

define_nodeMethod · 0.80
define_nodeMethod · 0.80
define_nodeMethod · 0.80
define_nodeMethod · 0.80
define_nodeMethod · 0.80
define_nodeMethod · 0.80
define_nodeMethod · 0.80

Calls 5

is_dequantFunction · 0.90
is_quantFunction · 0.90
is_param_nodeFunction · 0.90
from_q_dq_nodeMethod · 0.80

Tested by

no test coverage detected