class_docstr: Twins Vision Transfomer (Revisiting Spatial Attention)
  
  Adapted from PVT (PyramidVisionTransformer) class at https://github.com/whai362/PVT.git
code: def forward_features(self, x):
      B = x.shape[0]
      for i, (embed, drop, blocks, pos_blk) in enumerate(
          zip(
              self.patch_embeds,
              self.pos_drops,
              self.blocks,
              self.pos_block,
          )
      ):
          x, size = embed(x)
          x = drop(x)
          for j, blk in enumerate(blocks):
              x = blk(x, size)
              if j == 0:
                  x = pos_blk(x, size)  # PEG here
          if i < len(self.depths) - 1:
              x = (
                  x.reshape(B, *size, -1)
                  .permute(0, 3, 1, 2)
                  .contiguous()
              )
      x = self.norm(x)
      return x
  
imports: import math
  from functools import partial
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import Mlp, DropPath, to_2tuple, trunc_normal_, use_fused_attn
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_module
  from ._registry import register_model, generate_default_cfgs
  from .vision_transformer import Attention
label_desc: Use image node_id 8 for calling the Twins obj's underlying member method code with example usage: obj.forward_features(x) and returns: x