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

Function handler

backends/mlx/ops.py:406–413  ·  view source on GitHub ↗
(P: MLXProgramBuilder, n: Node)

Source from the content-addressed store, hash-verified

404 """Create a handler for a simple unary op: x → node_cls(x, out)."""
405
406 def handler(P: MLXProgramBuilder, n: Node) -> Slot:
407 args = P.args(n)
408 require_args(args, 1, 1, op_name)
409 require_kwargs(P.kwargs(n), set(), op_name)
410 x = args[0]
411 out = P.make_or_get_slot(n)
412 P.emit(node_cls(x=P.slot_to_tid(x), out=P.slot_to_tid(out)))
413 return out
414
415 handler.__name__ = f"_{op_name.replace('.', '_')}_handler"
416 handler.__doc__ = f"Handle {op_name} (table-driven unary op)."

Callers 1

_process_nodesMethod · 0.85

Calls 15

emit_lifted_constantFunction · 0.90
require_argsFunction · 0.85
require_kwargsFunction · 0.85
normalize_reduction_dimFunction · 0.85
_parse_pool_argsFunction · 0.85
_emit_pool_ndFunction · 0.85
argsMethod · 0.80
kwargsMethod · 0.80
emitMethod · 0.80
slot_to_tidMethod · 0.80

Tested by

no test coverage detected