tfc.ops.same_padding_for_kernel | TensorFlow v2.16.1 (original) (raw)
tfc.ops.same_padding_for_kernel
Stay organized with collections Save and categorize content based on your preferences.
Determine correct amount of padding for same
convolution.
View aliases
Main aliases
tfc.ops.same_padding_for_kernel(
shape, corr, strides_up=None
)
To implement 'same'
convolutions, we first pad the image, and then perform a'valid'
convolution or correlation. Given the kernel shape, this function determines the correct amount of padding so that the output of the convolution or correlation is the same size as the pre-padded input.
Args | |
---|---|
shape | Shape of the convolution kernel (without the channel dimensions). |
corr | Boolean. If True, assume cross correlation, if False, convolution. |
strides_up | If this is used for an upsampled convolution, specify the strides here. (For downsampled convolutions, specify (1, 1): in that case, the strides don't matter.) |
Returns |
---|
The amount of padding at the beginning and end for each dimension. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.