class_docstr: ConvNeXt Block. There are two equivalent implementations:
  (1) DwConv -> LayerNorm (channels_first) -> 1x1 Conv -> GELU -> 1x1 Conv; all in (N, C, H, W)
  (2) DwConv -> Permute to (N, H, W, C); LayerNorm (channels_last) -> Linear -> GELU -> Linear; Permute back
  We use (2) as we find it slightly faster in Pypaddle
  
  Args:
      dim (int): Number of input channels.
      drop_path (float): Stochastic depth rate. Default: 0.0
      layer_scale_init_value (float): Init value for Layer Scale. Default: 1e-6.
class_docstr_tok: ["ConvNeXt","Block",".","There","are","two","equivalent","implementations",":","(","1",")","DwConv","-",">","LayerNorm","(","channels_first",")","-",">","1x1","Conv","-",">","GELU","-",">","1x1","Conv",";","all","in","(","N",",","C",",","H",",","W",")","(","2",")","DwConv","-",">","Permute","to","(","N",",","H",",","W",",","C",")",";","LayerNorm","(","channels_last",")","-",">","Linear","-",">","GELU","-",">","Linear",";","Permute","back","We","use","(","2",")","as","we","find","it","slightly","faster","in","Pypaddle","Args",":","dim","(","int",")",":","Number","of","input","channels",".","drop_path","(","float",")",":","Stochastic","depth","rate",".","Default",":","0.0","layer_scale_init_value","(","float",")",":","Init","value","for","Layer","Scale",".","Default",":","1e-6","."]
code: def __init__(self, dim, drop_path=0.0, layer_scale_init_value=1e-6):
      super().__init__()
      self.dwconv = nn.Conv2D(
          dim, dim, kernel_size=7, padding=3, groups=dim
      )  # depthwise conv
      self.norm = LayerNorm(dim, eps=1e-6)
      self.pwconv1 = nn.Linear(
          dim, 4 * dim
      )  # pointwise/1x1 convs, implemented with linear layers
      self.act = nn.GELU()
      self.pwconv2 = nn.Linear(4 * dim, dim)
  
      if layer_scale_init_value > 0:
          self.gamma = self.create_parameter(
              shape=(dim,),
              attr=ParamAttr(
                  initializer=Constant(layer_scale_init_value)
              ),
          )
      else:
          self.gamma = None
  
      self.drop_path = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.nn.initializer import Constant
  import numpy
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
  from .transformer_utils import DropPath, trunc_normal_, zeros_
label_desc: Use image node_id 1 to create a new Block object from inherited base classes: nn with example: obj = Block(dim, drop_path, layer_scale_init_value)