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

Function _view_handler

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

Source from the content-addressed store, hash-verified

899 ]
900)
901def _view_handler(P: MLXProgramBuilder, n: Node) -> Slot:
902 args = P.args(n)
903 require_args(args, 2, 2, "aten.view")
904 require_kwargs(P.kwargs(n), set(), "aten.view")
905 x, shape = args
906 out = P.make_or_get_slot(n)
907
908 shape_iovs = [P.to_int_or_vid(s) for s in shape]
909 P.emit(
910 ReshapeNode(
911 x=P.slot_to_tid(x),
912 out=P.slot_to_tid(out),
913 shape=shape_iovs,
914 )
915 )
916 return out
917
918
919@REGISTRY.register(

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected