class_docstr: Residual Block w/ Spatial Gating
  
  Based on: `Pay Attention to MLPs` - https://arxiv.org/abs/2105.08050
code: def __init__(
      self,
      dim,
      seq_len,
      mlp_ratio=4,
      mlp_layer=GatedMlp,
      norm_layer=partial(nn.LayerNorm, eps=1e-6),
      act_layer=nn.GELU,
      drop=0.0,
      drop_path=0.0,
  ):
      super().__init__()
      channel_dim = int(dim * mlp_ratio)
      self.norm = norm_layer(dim)
      sgu = partial(SpatialGatingUnit, seq_len=seq_len)
      self.mlp_channels = mlp_layer(
          dim,
          channel_dim,
          act_layer=act_layer,
          gate_layer=sgu,
          drop=drop,
      )
      self.drop_path = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
  
imports: import math
  from functools import partial
  import torch
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import PatchEmbed, Mlp, GluMlp, GatedMlp, DropPath, lecun_normal_, to_2tuple
  from ._builder import build_model_with_cfg
  from ._manipulate import named_apply, checkpoint_seq
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 1 to create a new SpatialGatingBlock object from inherited base classes: nn with example: obj = SpatialGatingBlock(dim, seq_len, mlp_ratio, mlp_layer, norm_layer, act_layer, drop, drop_path)