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

Function _clone_handler

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

Source from the content-addressed store, hash-verified

924 ]
925)
926def _clone_handler(P: MLXProgramBuilder, n: Node) -> Slot:
927 args = P.args(n)
928 kwargs = P.kwargs(n)
929 require_args(args, 1, 1, "aten.clone")
930 require_kwargs(kwargs, {"memory_format"}, "aten.clone")
931 require_contiguous_format(
932 memory_format=kwargs.get("memory_format"),
933 op_name="aten.clone",
934 )
935 (x,) = args
936 out = P.make_or_get_slot(n)
937 P.emit(
938 ContiguousNode(
939 x=P.slot_to_tid(x),
940 out=P.slot_to_tid(out),
941 )
942 )
943 return out
944
945
946@REGISTRY.register(target=[torch.ops.aten.copy.default])

Callers

nothing calls this directly

Calls 9

require_argsFunction · 0.85
require_kwargsFunction · 0.85
argsMethod · 0.80
kwargsMethod · 0.80
emitMethod · 0.80
slot_to_tidMethod · 0.80
getMethod · 0.45
make_or_get_slotMethod · 0.45

Tested by

no test coverage detected