class_docstr: CNN Feature Map Embedding
  Extract feature map from CNN, flatten, project to embedding dim.
class_docstr_tok: ["CNN","Feature","Map","Embedding","Extract","feature","map","from","CNN",",","flatten",",","project","to","embedding","dim","."]
code: def forward(self, x) -> Tuple[torch.Tensor, List[int]]:
      x = self.backbone(x)
      if isinstance(x, (list, tuple)):
          x = x[
              -1
          ]  # last feature if backbone outputs list/tuple of features
      x = self.proj(x)
      return x.flatten(2).transpose(1, 2), x.shape[-2:]
  
imports: from functools import partial
  from typing import List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import StdConv2dSame, StdConv2d, to_2tuple, Format, nchw_to
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
  from .resnet import resnet26d, resnet50d
  from .resnetv2 import ResNetV2, create_resnetv2_stem
  from .vision_transformer import _create_vision_transformer, VisionTransformer
label_desc: Use image node_id 2 for calling the HybridEmbedWithSize obj's underlying member method code with example usage: obj.forward(x) and returns: x,  x