class_docstr: ResNet model from
  `"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_
  
  Args:
      Block (BasicBlock|BottleneckBlock): block module of model.
      depth (int): layers of resnet, default: 50.
      width (int): base width of resnet, default: 64.
      num_classes (int): output dim of last fc layer. If num_classes <=0, last fc layer
                          will not be defined. Default: 1000.
      with_pool (bool): use pool before the last fc layer or not. Default: True.
  
  Examples:
      .. code-block:: python
  
          import paddle
          from paddle.vision.models import ResNet
          from paddle.vision.models.resnet import BottleneckBlock, BasicBlock
  
          resnet50 = ResNet(BottleneckBlock, 50)
  
          wide_resnet50_2 = ResNet(BottleneckBlock, 50, width=64*2)
  
          resnet18 = ResNet(BasicBlock, 18)
  
          x = paddle.rand([1, 3, 224, 224])
          out = resnet18(x)
  
          print(out.shape)
code: def forward(self, x):
      x = self.conv1(x)
      x = self.bn1(x)
      x = self.relu(x)
      x = self.maxpool(x)
      x = self.layer1(x)
      x = self.layer2(x)
      x = self.layer3(x)
      x = self.layer4(x)
  
      if self.with_pool:
          x = self.avgpool(x)
  
      if self.num_classes > 0:
          x = paddle.flatten(x, 1)
          x = self.fc(x)
  
      return x
  
imports: from __future__ import print_function
  import paddle
  import paddle.nn
  from paddle.utils.download import get_weights_path_from_url
label_desc: Use image node_id 3 for calling the ResNet obj's underlying member method code with example usage: obj.forward(x) and returns: x