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

Function _normalize_conv_param

backends/mlx/ops.py:2561–2569  ·  view source on GitHub ↗

Normalize a conv parameter (stride/padding/etc.) to a list of length ndim.

(val, ndim, default=0)

Source from the content-addressed store, hash-verified

2559
2560
2561def _normalize_conv_param(val, ndim, default=0):
2562 """Normalize a conv parameter (stride/padding/etc.) to a list of length ndim."""
2563 if isinstance(val, int):
2564 return [val] * ndim
2565 if isinstance(val, list):
2566 if len(val) == 1:
2567 return val * ndim
2568 return val
2569 return [default] * ndim
2570
2571
2572@REGISTRY.register(target=[torch.ops.aten.convolution.default])

Callers 7

_conv1d_handlerFunction · 0.85
_conv2d_handlerFunction · 0.85
_conv3d_handlerFunction · 0.85
_convolution_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected