class_docstr: 3D patch embedding for video.
  
  Args:
      patch_size (`int`):
          Patch token size.
      c (`int`):
          Number of input video channels..
      embed_dim (`int`):
          Number of linear projection output channels.
      norm_layer (`nn.Module`):
          Normalization layer.
      stride (`tuple[int]`):
          Stride size.
class_docstr_tok: ["3D","patch","embedding","for","video",".","Args",":","patch_size","(","`","int","`",")",":","Patch","token","size",".","c","(","`","int","`",")",":","Number","of","input","video","channels","..","embed_dim","(","`","int","`",")",":","Number","of","linear","projection","output","channels",".","norm_layer","(","`","nn.Module","`",")",":","Normalization","layer",".","stride","(","`","tuple","[","int","]","`",")",":","Stride","size","."]
code: def forward(self, x):
      # do padding
      _, _, d, h, w = x.size()
      if w % self.patch_size[2] != 0:
          x = F.pad(x, (0, self.patch_size[2] - w % self.patch_size[2]))
      if h % self.patch_size[1] != 0:
          x = F.pad(
              x, (0, 0, 0, self.patch_size[1] - h % self.patch_size[1])
          )
      if d % self.patch_size[0] != 0:
          x = F.pad(
              x,
              (
                  0,
                  0,
                  0,
                  0,
                  0,
                  self.patch_size[0] - d % self.patch_size[0],
              ),
          )
  
      if self.additional_variable_channels:
          x_rgb = x[:, :3, ...]
          x_rem = x[:, 3:, ...]
          x_rgb = self.proj(x_rgb)
          if x.shape[1] > 3:
              x_rem = self.run_variable_channel_forward(x_rem)
              x = x_rgb + x_rem
          else:
              x = x_rgb
      else:
          x = self.proj(x)  # b c d h w
      if self.norm is not None:
          d, h, w = x.size(2), x.size(3), x.size(4)
          x = x.flatten(2).transpose(1, 2)
          x = self.norm(x)
          x = x.transpose(1, 2).view(-1, self.embed_dim, d, h, w)
  
      return x
  
imports: from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the PatchEmbed3D obj's underlying member method code with example usage: obj.forward(x) and returns: x