class_docstr: 2D Convolutions like TensorFlow, for a dynamic image size.
  The padding is operated in forward function by calculating dynamically.
class_docstr_tok: ["2D","Convolutions","like","TensorFlow",",","for","a","dynamic","image","size",".","The","padding","is","operated","in","forward","function","by","calculating","dynamically","."]
code: def forward(self, x):
      ih, iw = x.size()[-2:]
      kh, kw = self.weight.size()[-2:]
      sh, sw = self.stride
      oh, ow = math.ceil(ih / sh), math.ceil(
          iw / sw
      )  # change the output size according to stride ! ! !
      pad_h = max(
          (oh - 1) * self.stride[0]
          + (kh - 1) * self.dilation[0]
          + 1
          - ih,
          0,
      )
      pad_w = max(
          (ow - 1) * self.stride[1]
          + (kw - 1) * self.dilation[1]
          + 1
          - iw,
          0,
      )
      if pad_h > 0 or pad_w > 0:
          x = F.pad(
              x,
              [
                  pad_w // 2,
                  pad_w - pad_w // 2,
                  pad_h // 2,
                  pad_h - pad_h // 2,
              ],
          )
      return F.conv2d(
          x,
          self.weight,
          self.bias,
          self.stride,
          self.padding,
          self.dilation,
          self.groups,
      )
  
imports: import re
  import math
  import collections
  from functools import partial
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.utils import model_zoo
label_desc: Use image node_id 2 for calling the Conv2dDynamicSamePadding obj's underlying member method code with example usage: obj.forward(x) and returns: F