MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / get_padding

Function get_padding

timm/models/layers/padding.py:12–14  ·  view source on GitHub ↗
(kernel_size: int, stride: int = 1, dilation: int = 1, **_)

Source from the content-addressed store, hash-verified

10
11# Calculate symmetric padding for a convolution
12def 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

Callers 4

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
get_padding_valueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected