class_docstr: ConvNeXt
      A Pypaddle impl of : `A ConvNet for the 2020s`  -
        https://arxiv.org/pdf/2201.03545.pdf
  
  Args:
      in_chans (int): Number of input image channels. Default: 3
      depths (tuple(int)): Number of blocks at each stage. Default: [3, 3, 9, 3]
      dims (int): Feature dimension at each stage. Default: [96, 192, 384, 768]
      drop_path_rate (float): Stochastic depth rate. Default: 0.
      layer_scale_init_value (float): Init value for Layer Scale. Default: 1e-6.
class_docstr_tok: ["ConvNeXt","A","Pypaddle","impl","of",":","`","A","ConvNet","for","the","2020s","`","-","https",":","\/\/arxiv.org\/pdf\/2201.03545.pdf","Args",":","in_chans","(","int",")",":","Number","of","input","image","channels",".","Default",":","3","depths","(","tuple","(","int",")",")",":","Number","of","blocks","at","each","stage",".","Default",":","[","3",",","3",",","9",",","3","]","dims","(","int",")",":","Feature","dimension","at","each","stage",".","Default",":","[","96",",","192",",","384",",","768","]","drop_path_rate","(","float",")",":","Stochastic","depth","rate",".","Default",":","0.","layer_scale_init_value","(","float",")",":","Init","value","for","Layer","Scale",".","Default",":","1e-6","."]
code: def __init__(
      self,
      arch="tiny",
      in_chans=3,
      drop_path_rate=0.0,
      layer_scale_init_value=1e-6,
      return_idx=[1, 2, 3],
      norm_output=True,
      pretrained=None,
  ):
      super().__init__()
      depths = self.arch_settings[arch]["depths"]
      dims = self.arch_settings[arch]["dims"]
      self.downsample_layers = (
          nn.LayerList()
      )  # stem and 3 intermediate downsampling conv layers
      stem = nn.Sequential(
          nn.Conv2D(in_chans, dims[0], kernel_size=4, stride=4),
          LayerNorm(dims[0], eps=1e-6, data_format="channels_first"),
      )
      self.downsample_layers.append(stem)
      for i in range(3):
          downsample_layer = nn.Sequential(
              LayerNorm(
                  dims[i], eps=1e-6, data_format="channels_first"
              ),
              nn.Conv2D(dims[i], dims[i + 1], kernel_size=2, stride=2),
          )
          self.downsample_layers.append(downsample_layer)
  
      self.stages = (
          nn.LayerList()
      )  # 4 feature resolution stages, each consisting of multiple residual blocks
      dp_rates = [
          x for x in np.linspace(0, drop_path_rate, sum(depths))
      ]
      cur = 0
      for i in range(4):
          stage = nn.Sequential(
              *[
                  Block(
                      dim=dims[i],
                      drop_path=dp_rates[cur + j],
                      layer_scale_init_value=layer_scale_init_value,
                  )
                  for j in range(depths[i])
              ]
          )
          self.stages.append(stage)
          cur += depths[i]
  
      self.return_idx = return_idx
      self.dims = [dims[i] for i in return_idx]  # [::-1]
  
      self.norm_output = norm_output
      if norm_output:
          self.norms = nn.LayerList(
              [
                  LayerNorm(c, eps=1e-6, data_format="channels_first")
                  for c in self.dims
              ]
          )
  
      self.apply(self._init_weights)
  
      if pretrained is not None:
          if "http" in pretrained:  # URL
              path = paddle.utils.download.get_weights_path_from_url(
                  pretrained
              )
          else:  # model in local path
              path = pretrained
          self.set_state_dict(paddle.load(path))
  
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 ConvNeXt object from inherited base classes: nn with example: obj = ConvNeXt(arch, in_chans, drop_path_rate, layer_scale_init_value, return_idx, norm_output, pretrained)