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

Function _conv_transpose2d_handler

backends/mlx/ops.py:2650–2677  ·  view source on GitHub ↗

Handle aten.conv_transpose2d: (input, weight, bias, stride, padding, output_padding, groups, dilation).

(P: MLXProgramBuilder, n: Node)

Source from the content-addressed store, hash-verified

2648
2649@REGISTRY.register(target=[torch.ops.aten.conv_transpose2d.input])
2650def _conv_transpose2d_handler(P: MLXProgramBuilder, n: Node) -> Slot:
2651 """Handle aten.conv_transpose2d: (input, weight, bias, stride, padding, output_padding, groups, dilation)."""
2652 require_args(n.args, 2, 8, "aten.conv_transpose2d")
2653 require_kwargs(P.kwargs(n), set(), "aten.conv_transpose2d")
2654 x_node, w_node = n.args[0:2]
2655 bias_node = n.args[2] if len(n.args) > 2 else None
2656 groups = n.args[6] if len(n.args) > 6 else 1
2657
2658 stride = _normalize_conv_param(n.args[3] if len(n.args) > 3 else [1, 1], 2, 1)
2659 padding = _normalize_conv_param(n.args[4] if len(n.args) > 4 else [0, 0], 2, 0)
2660 output_padding = _normalize_conv_param(
2661 n.args[5] if len(n.args) > 5 else [0, 0], 2, 0
2662 )
2663 dilation = _normalize_conv_param(n.args[7] if len(n.args) > 7 else [1, 1], 2, 1)
2664
2665 return _emit_conv_transpose(
2666 P,
2667 n,
2668 x_node,
2669 w_node,
2670 bias_node,
2671 stride,
2672 padding,
2673 dilation,
2674 output_padding,
2675 groups,
2676 ndim=2,
2677 )
2678
2679
2680@REGISTRY.register(target=[torch.ops.aten.conv_transpose3d.input])

Callers

nothing calls this directly

Calls 5

require_argsFunction · 0.85
require_kwargsFunction · 0.85
_normalize_conv_paramFunction · 0.85
_emit_conv_transposeFunction · 0.85
kwargsMethod · 0.80

Tested by

no test coverage detected