code: def net(self, input, class_dim=101):
      layers = self.layers
      seg_num = self.seg_num
      supported_layers = [50, 101, 152]
      assert (
          layers in supported_layers
      ), "supported layers are {} but input layer is {}".format(
          supported_layers, layers
      )
  
      # reshape input
      channels = input.shape[2]
      short_size = input.shape[3]
      input = fluid.layers.reshape(
          x=input, shape=[-1, channels, short_size, short_size]
      )
  
      if layers == 50:
          depth = [3, 4, 6, 3]
      elif layers == 101:
          depth = [3, 4, 23, 3]
      elif layers == 152:
          depth = [3, 8, 36, 3]
      num_filters = [64, 128, 256, 512]
  
      conv = self.conv_bn_layer(
          input=input,
          num_filters=64,
          filter_size=7,
          stride=2,
          act="relu",
          name="conv1",
      )
      conv = fluid.layers.pool2d(
          input=conv,
          pool_size=3,
          pool_stride=2,
          pool_padding=1,
          pool_type="max",
      )
  
      for block in range(len(depth)):
          for i in range(depth[block]):
              if layers in [101, 152] and block == 2:
                  if i == 0:
                      conv_name = "res" + str(block + 2) + "a"
                  else:
                      conv_name = "res" + str(block + 2) + "b" + str(i)
              else:
                  conv_name = "res" + str(block + 2) + chr(97 + i)
  
              conv = self.bottleneck_block(
                  input=conv,
                  num_filters=num_filters[block],
                  stride=2 if i == 0 and block != 0 else 1,
                  name=conv_name,
              )
  
      pool = fluid.layers.pool2d(
          input=conv, pool_size=7, pool_type="avg", global_pooling=True
      )
  
      feature = fluid.layers.reshape(
          x=pool, shape=[-1, seg_num, pool.shape[1]]
      )
      return feature
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/models/tsn/tsn_res_model.py
imports: import os
  import time
  import sys
  import paddle.fluid
  import math
label_desc: Use image node_id 5 for calling the TSN_ResNet obj's underlying member method code with example usage: obj.net(input, class_dim) and returns: feature