Normalize a conv parameter (stride/padding/etc.) to a list of length ndim.
(val, ndim, default=0)
| 2559 | |
| 2560 | |
| 2561 | def _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]) |
no outgoing calls
no test coverage detected