code: def __init__(
      self,
      in_channels,
      channels,
      stride=1,
      downsample=False,
      conv_weight_attr=None,
      bn_weight_attr=None,
  ):
      super().__init__()
      self.conv1 = conv3x3(
          in_channels,
          channels,
          stride,
          conv_weight_attr=conv_weight_attr,
      )
      self.bn1 = nn.BatchNorm2D(channels, weight_attr=bn_weight_attr)
      self.relu = nn.ReLU()
      self.conv2 = conv3x3(
          channels, channels, conv_weight_attr=conv_weight_attr
      )
      self.bn2 = nn.BatchNorm2D(channels, weight_attr=bn_weight_attr)
      self.downsample = downsample
      if downsample:
          self.downsample = nn.Sequential(
              nn.Conv2D(
                  in_channels,
                  channels * self.expansion,
                  1,
                  stride,
                  weight_attr=conv_weight_attr,
                  bias_attr=False,
              ),
              nn.BatchNorm2D(
                  channels * self.expansion, weight_attr=bn_weight_attr
              ),
          )
      else:
          self.downsample = nn.Sequential()
      self.stride = stride
  
file_path: PaddleOCR/ppocr/modeling/backbones/rec_resnet_31.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  import numpy
label_desc: Use image node_id 1 to create a new BasicBlock object from inherited base classes: nn with example: obj = BasicBlock(in_channels, channels, stride, downsample, conv_weight_attr, bn_weight_attr)