code: def __init__(
      self,
      inp,
      oup,
      reduction=4,
      act_max=1.0,
      act_relu=True,
      init_a=[0.0, 0.0],
      init_b=[0.0, 0.0],
      relu_before_pool=False,
      g=None,
      expansion=False,
  ):
      super(DYShiftMax, self).__init__()
      self.oup = oup
      self.act_max = act_max * 2
      self.act_relu = act_relu
      self.avg_pool = nn.Sequential(
          nn.ReLU() if relu_before_pool == True else nn.Sequential(),
          nn.AdaptiveAvgPool2D(1),
      )
  
      self.exp = 4 if act_relu else 2
      self.init_a = init_a
      self.init_b = init_b
  
      # determine squeeze
      squeeze = make_divisible(inp // reduction, 4)
      if squeeze < 4:
          squeeze = 4
  
      self.fc = nn.Sequential(
          nn.Linear(inp, squeeze),
          nn.ReLU(),
          nn.Linear(squeeze, oup * self.exp),
          nn.Hardsigmoid(),
      )
  
      if g is None:
          g = 1
      self.g = g[1]
      if self.g != 1 and expansion:
          self.g = inp // self.g
  
      self.gc = inp // self.g
      index = paddle.to_tensor([range(inp)])
      index = paddle.reshape(index, [1, inp, 1, 1])
      index = paddle.reshape(index, [1, self.g, self.gc, 1, 1])
      indexgs = paddle.split(index, [1, self.g - 1], axis=1)
      indexgs = paddle.concat((indexgs[1], indexgs[0]), axis=1)
      indexs = paddle.split(indexgs, [1, self.gc - 1], axis=2)
      indexs = paddle.concat((indexs[1], indexs[0]), axis=2)
      self.index = paddle.reshape(indexs, [inp])
      self.expansion = expansion
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  from ppocr.modeling.backbones.det_mobilenet_v3 import make_divisible
label_desc: Use image node_id 1 to create a new DYShiftMax object from inherited base classes: nn with example: obj = DYShiftMax(inp, oup, reduction, act_max, act_relu, init_a, init_b, relu_before_pool, g, expansion)