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

Function _dim_order_clone_handler

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

Source from the content-addressed store, hash-verified

966
967@REGISTRY.register(target=[exir_ops.edge.dim_order_ops._clone_dim_order.default])
968def _dim_order_clone_handler(P: MLXProgramBuilder, n: Node) -> Slot:
969 # dim_order_ops._clone_dim_order(Tensor self, *, bool non_blocking=False, int[]? dim_order=None) -> Tensor
970 # This is essentially a contiguous/clone operation for memory layout
971 args = P.args(n)
972 kwargs = P.kwargs(n)
973 require_args(args, 1, 1, "dim_order_ops._clone_dim_order")
974 require_kwargs(
975 kwargs, {"non_blocking", "dim_order"}, "dim_order_ops._clone_dim_order"
976 )
977 require_contiguous_format(
978 dim_order=kwargs.get("dim_order"),
979 op_name="dim_order_ops._clone_dim_order",
980 )
981 x = args[0]
982 out = P.make_or_get_slot(n)
983 P.emit(
984 ContiguousNode(
985 x=P.slot_to_tid(x),
986 out=P.slot_to_tid(out),
987 )
988 )
989 return out
990
991
992# Handle Edge IR's dim_order_ops._to_dim_order_copy (dtype conversion)

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