(kernel_size: int, stride: int = 1, dilation: int = 1, **_)
| 10 | |
| 11 | # Calculate symmetric padding for a convolution |
| 12 | def get_padding(kernel_size: int, stride: int = 1, dilation: int = 1, **_) -> int: |
| 13 | padding = ((stride - 1) + dilation * (kernel_size - 1)) // 2 |
| 14 | return padding |
| 15 | |
| 16 | |
| 17 | # Calculate asymmetric TensorFlow-like 'SAME' padding for a convolution |
no outgoing calls
no test coverage detected