towhee.models.layers.padding_functions.pad_same

towhee.models.layers.padding_functions.pad_same(x: Tensor, k: List[int], s: List[int], d: List[int] = (1, 1), value: float = 0) Tensor[source]

Dynamically pad input x with ‘SAME’ padding for conv with specified args :param x: Input tensor. :type x: torch.Tensor :param k: Convolution kernel sizes. :type k: List[Int] :param s: Convolution stride parameters. :type s: List[Int] :param d: Convolution dilation parameter. :type d: List[Int] :param value: Value for padding. :type value: Float

Returns:

Output Tensor for conv with ‘SAME’ padding.

Return type:

(torch.Tensor)