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

Method maybe_create

backends/mlx/patterns.py:1096–1108  ·  view source on GitHub ↗
(cls, ep, head)

Source from the content-addressed store, hash-verified

1094
1095 @classmethod
1096 def maybe_create(cls, ep, head):
1097 if not match_target(head, torch.ops.aten.linear.default):
1098 return None
1099 x, dequant = head.args[0:2]
1100 if not isinstance(dequant, Node):
1101 return None
1102 if not has_single_user(dequant):
1103 return None
1104 parsed = parse_dequant_nvfp4_node(dequant)
1105 if parsed is None:
1106 return None
1107 qdata, scale, per_tensor_scale, output_dtype = parsed
1108 return cls(head, [dequant], qdata, scale, per_tensor_scale, output_dtype)
1109
1110 def __call__(self, P, n):
1111 assert n == self.head

Callers

nothing calls this directly

Calls 3

match_targetFunction · 0.90
has_single_userFunction · 0.90
parse_dequant_nvfp4_nodeFunction · 0.90

Tested by

no test coverage detected