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

Method maybe_create

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

Source from the content-addressed store, hash-verified

562
563 @classmethod
564 def maybe_create(cls, ep, head):
565 if not match_target(head, torch.ops.aten.embedding.default):
566 return None
567
568 w, x = head.args[0:2]
569 if not isinstance(w, Node):
570 return None
571 if not has_single_user(w):
572 return None
573 parsed = parse_dequant_nvfp4_node(w)
574 if parsed is None:
575 return None
576 qdata, scale, per_tensor_scale, output_dtype = parsed
577 return cls(head, [w], qdata, scale, per_tensor_scale, output_dtype)
578
579 def __call__(self, P: MLXProgramBuilder, n: Node) -> Slot:
580 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