code: def make_res_layer(
      block,
      inplanes,
      planes,
      blocks,
      spatial_stride=1,
      temporal_stride=1,
      dilation=1,
      inflate_freq=1,
      inflate_style="3x1x1",
      nonlocal_freq=1,
      nonlocal_cfg=None,
      norm_layer=BatchNorm3d,
      norm_kwargs=None,
      layer_name="",
  ):
      inflate_freq = (
          inflate_freq
          if not isinstance(inflate_freq, int)
          else (inflate_freq,) * blocks
      )
      nonlocal_freq = (
          nonlocal_freq
          if not isinstance(nonlocal_freq, int)
          else (nonlocal_freq,) * blocks
      )
      assert len(inflate_freq) == blocks
      assert len(nonlocal_freq) == blocks
  
      downsample = None
      if spatial_stride != 1 or inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              nn.Conv3d(
                  in_channels=inplanes,
                  out_channels=planes * block.expansion,
                  kernel_size=1,
                  stride=(
                      temporal_stride,
                      spatial_stride,
                      spatial_stride,
                  ),
                  bias=False,
              ),
              norm_layer(
                  num_features=planes * block.expansion,
                  **({} if norm_kwargs is None else norm_kwargs),
              ),
          )
  
      layers = []
      cnt = 0
      layers.append(
          block(
              inplanes=inplanes,
              planes=planes,
              spatial_stride=spatial_stride,
              temporal_stride=temporal_stride,
              dilation=dilation,
              downsample=downsample,
              if_inflate=(inflate_freq[0] == 1),
              inflate_style=inflate_style,
              if_nonlocal=(nonlocal_freq[0] == 1),
              nonlocal_cfg=nonlocal_cfg,
              layer_name="%d_" % cnt,
          )
      )
  
      cnt += 1
      inplanes = planes * block.expansion
      for i in range(1, blocks):
          layers.append(
              block(
                  inplanes=inplanes,
                  planes=planes,
                  spatial_stride=1,
                  temporal_stride=1,
                  dilation=dilation,
                  if_inflate=(inflate_freq[i] == 1),
                  inflate_style=inflate_style,
                  if_nonlocal=(nonlocal_freq[i] == 1),
                  nonlocal_cfg=nonlocal_cfg,
                  layer_name="%d_" % cnt,
              )
          )
          cnt += 1
      return nn.Sequential(*layers)
  
imports: import torch
  import torch.nn
  from torch.nn import BatchNorm3d
  from .non_local import build_nonlocal_block
label_desc: Use image node_id 3 for calling a global function with example usage: make_res_layer(block, inplanes, planes, blocks, spatial_stride, temporal_stride, dilation, inflate_freq, inflate_style, nonlocal_freq, nonlocal_cfg, norm_layer, norm_kwargs, layer_name) and returns: nn