towhee.models.layers.padding_functions.same_padding

towhee.models.layers.padding_functions.same_padding(x: Tensor, in_height: int, in_width: int, stride_h: int, stride_w: int, filter_height: int, filter_width: int) Tensor[source]
Parameters:
  • x (torch.Tensor) – Input tensor.

  • in_height (int) – Input height.

  • in_width (int) – Input width.

  • stride_h (int) – stride height.

  • stride_w (int) – stride width.

  • filter_height (int) – filter height.

  • filter_width (int) – filter width.

Returns:

Output Tensor for conv with ‘SAME’ padding.

Return type:

(torch.Tensor)