class_docstr: Compute the 2d image patch embedding ready to pass to transformer encoder.
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      x = self.backbone(x)
      B, N, _, _ = x.shape
      x = x.view(B, N, -1).permute(0, 2, 1)  # BxNxE
      cls_tokens = self.cls_token.repeat(B, 1, 1)  # Bx1xE
      # prepend the cls token to the input
      x = torch.cat([cls_tokens, x], dim=1)  # Bx(N+1)xE
      # add position embedding
      x += self.positions
      return x
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 3 for calling the PatchEmbedding obj's underlying member method code with example usage: obj.forward(x) and returns: x