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

Method _mark_noop

backends/mlx/builder/program_builder.py:476–490  ·  view source on GitHub ↗

Mark noops and dead nodes.

(self)

Source from the content-addressed store, hash-verified

474 self.make_or_get_slot(o, id_space=IdSpace.Output)
475
476 def _mark_noop(self):
477 """Mark noops and dead nodes."""
478 dead = set()
479 noop_handler = REGISTRY.get_noop_handler()
480 if noop_handler is None:
481 return
482
483 for n in reversed(self.ep.graph.nodes):
484 handler = REGISTRY.get_handler(n)
485 if handler == noop_handler:
486 dead.add(n)
487
488 if n.op != "output" and all(user in dead for user in n.users):
489 self.node_info[n].handler = noop_handler
490 dead.add(n)
491
492 def _apply_patterns(self) -> None:
493 """

Callers 1

_process_nodesMethod · 0.95

Calls 3

get_noop_handlerMethod · 0.80
get_handlerMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected